Ticket Q500084
Visible to All Users

Tab document position

created 12 years ago

How to retrieve the display indices of documents tabbed in TabbedView after reordering them. And is there any event that fired after document is reordered in the TabbedView?

I have used tabbedView.Documents.IndexOf(myDocument), which returns the index of document in order it was added to the TabbedView not the current position .

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hi,
The position of the docked document in the tabbed view is determined by the document index in its group. So, you can use the following code to get the document position.

C#
Document currentDocument = tabbedView1.ActiveDocument as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; int index = currentDocument.Parent.Items.IndexOf(currentDocument);

I have created a sample project to illustrate this approach.
To detect when an end-user changes the document position, use the TabbedView.BeginDocking and TabbedView.EndDocking events.
Should you have any further questions, feel free to contact me at any time.

    Comments (2)

      Thank you… it's working.

      DevExpress Support Team 12 years ago

        You are welcome, Salman. Please contact us if you need further assistance.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.