I want to set a specific tab as the active tab based on a tool click event. How do I get at the active tab/focus property for a specific tab on a form?
Looks like I need to create an instance of a DockableControlPane for the tab I want to activate. Pretty complicated and specific to the whole screen design so no worries if no one has any input.
Tim,
Which control on which platform are you using?
What Infragistics control and on which platform is your question about? I need to know what control the Epicor control you are using derives from to be able to assist you.
Let me know if you have any questions with this matter.
This did not paste very well. Not sure you can help but this is the code to get at a control that is a pre-defined tab and has a property for it on the BasePanel. I added another tab after this one that I need to get at. If I could reference it by index, that would work but have no idea how to do that.
Epicor.Mfg.UI.App.HelpDeskEntry.Panels.MainPanel jp = new MainPanel();
UltraDockManager udm = jp.caseEntryPanel1.caseSheetPanel1.baseDockManager;
Epicor.Mfg.UI.FrameWork.EpiBasePanel qq = jp.caseEntryPanel1.caseSheetPanel1.contactsListPanel1;
DockableControlPane dcc = udm.PaneFromControl(qq);
dcc.Activate();
You should be able to do that by setting the IsSelectedTab property of the DockableControlPane to true.
Try something like this:
udm.ControlPanes[udm.ControlPanes.Count - 1].IsSelectedTab = true;
Let me know if that works for you.
Did that suggestion work for you?
Unfortunately, no. I believe I need to get at the Activate() method for the tab. Because these are Epicor screens and I can't see how the panel is wired up to the screen, this is not a very simple problem. For now, I am moving on and will revisit this after I get the rest of the screen changes done.
Thank you for your feedback.
Tim, I am 6 years late, but perhaps this will help someone else.
To do this, I grabbed the MainDockPanel of the form via csm. Then I was able to use ActivateSheet(name of sheet) to focus. Note this will not work in the InitializeCode since apparently the panel isnt configured yet, but anytime from OnLoad on should work. Also note, it handles multiple layers, in my case this MassEntry tab is 3 deep from the MainDockPanel
Example:
var mdp =(Erp.UI.App.SelectSerialNumbersEntry.MainDockPanel) csm.GetNativeControlReference("29b56335-57d8-4247-9867-e2fcb166cc2c"); mdp.ActivateSheet("MassEntry");
OK, let me know when you get the rest of the screen changes done.