We have an issue with the order of Tabs when using a TabGroupPane inside a DocumentContentHost. We are programmatically adding additional ContentPanes to the TabGroupPane. Each time we add a new ContentPane, the new Tabs are added to the right of the last tab. This is the behavior users expect. Once we get enough tabs so that they will not all display, subsequently additional ContentPanes are added to the far left, shifting the entire order of Tabs to the right.
Our issue looks like the issue mentioned here: http://ko.infragistics.com/community/forums/p/69302/350956.aspx#350956
The statements in the above thread are only partially correct. Visual Studio does not behave that way. It always inserts to the left. So there is inconsistency between Infragistics implementation and VisualStudio’s implementation.
I agree with the OP in the thread above = we should be able to insert and it display appropriately. If nothing else, it the TabGroupPane should always insert to the left when in the DocumentContentHost – just like VisualStudio.
Also note that if I Left-Click and Drag on a Tab and drop it on another Tab, I can rearrange the order. Some mechanism should exist that will allow us to do that programmatically. Insert then should insert and display at the expected index.
- jeremiah
The AddDocument method of the xamDockManager does only insert a tab at the first spot which mimics the behavior of VS when you open a document (that the item appears are the left as you noted). Note, when I mention VS I am refering primarily to VS 2008 as that was the current version when the control was developed and therefore was the basis for the behavior implemented.
If however, you are populating the Items collection of the TabGroupPane then the order of the items is exactly how you populate it so you have control over the order. The only time that the pane will be shifted to the first position (i.e. on the left) is when a tab/pane is selected/activated/focused and it is not within the visible area. Again this mimics the behavior of VS which does this presumably because scrolling is not available in the tabbed document area. The default template for the TabGroupPane when hosted within a DocumentContentHost is designed to mimic the behavior of VS and uses a custom panel to accomplish that so if you do not want the shifting you can re-template the element (e.g. create a controltemplate for TabGroupPane with a key of {x:Static igDock:TabGroupPane.DocumentTabGroupTemplateKey}, create your template to support scrolling and do not use an ItemsPresenter but directly contain the panel to be used (since the default ItemsPanel when in the Document area is the DocumentTabPanel).
"The only time that the pane will be shifted to the first position (i.e. on the left) is when a tab/pane is selected/activated/focused and it is not within the visible area."
Regardless of how this control functions - it has the same end result of not giving me control over the order of Tabs in a Tab control. For the TabGroupPane: Is there a way to create the new tabs on a new row once the horizontal space has been filled with tabs without having to retemplate?