How to change from one tab or panel to custom tab or panel?
I tried the below code, but it did not work.
Ice.Lib.Framework.EpiBasePanel UHDropShip = (Ice.Lib.Framework.EpiBasePanel)this.csm.GetNativeControlReference(“7394a96e-723b-437e-8147-0dda96d4e9c4”);
UHDropShip.Focus();
The panel UHDropShip is the custom panel/tab I want to get to. Any ideas?
I get the below error when I try UHDropShip.Activate();
Error: CS1061 - line 1653 (5423) - ‘Ice.Lib.Framework.EpiBasePanel’ does not contain a definition for ‘Activate’ and no extension method ‘Activate’ accepting a first argument of type ‘Ice.Lib.Framework.EpiBasePanel’ could be found (are you missing a using directive or an assembly reference?)
Sorry. I was trying to go from memory.
It is quite a bit more involved.
You have to get access to the DockManager and then get the control pane and then set the IsSelectedTab property to true. Sample Code (replace “inventoryList” with your panel’s name)
private void SetPaneProperties( System.Windows.Forms.Control.ControlCollection ctls = null)
{
// Enumerate the forms controls looking for the Epicor dock manager
if (ctls == null)
ctls = oTrans.EpiBaseForm.Controls;
foreach (Control ctl in ctls)
{
if (ctl.HasChildren)
SetPaneProperties(ctl.Controls);
if ((ctl) is Infragistics.Win.UltraWinDock.WindowDockingArea)
{
object objDockManager = ctl.GetType().InvokeMember("DockManager", BindingFlags.GetProperty | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase, null, ctl, null);
// Once found get a handle to the Infragistics dock manager using relection
Infragistics.Win.UltraWinDock.UltraDockManager udm = (Infragistics.Win.UltraWinDock.UltraDockManager)objDockManager;
foreach (Infragistics.Win.UltraWinDock.DockableControlPane p in udm.ControlPanes)
{
if ((p.Key.ToString() == "inventoryList"))
p.IsSelectedTab = true;
}
}
}
}
Solved it. After I added the field.Focus(), before the p.IsSelectedTab = true, it works now.
if ((p.Key.ToString() == “UHDropShip”)) {
cmbUhOrderType.Focus(); //after this is added, we go to Header tab > Detail tab.
p.IsSelectedTab = true; //goes to the UHDropShip tab.
}
Thanks for your help.