This is a migrated thread and some comments may be shown as answers.

raddock document tab order

3 Answers 262 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Saghar
Top achievements
Rank 1
Saghar asked on 01 Oct 2013, 02:02 PM
dear friends,
i have a big problem . i use raddock for my project.as u know when it show a form it becomes a tab in raddock,when these document tab open,they have an order. user can change the order of these tabs by dragging them, my problem is that i want to save this layout and the order of these tabs when close the application and open it again, i have written code for this problem to save these order in xml and load it when the application open,but its not ok when number of tabs got over the space of raddock.please notice that my raddock is right to left.
i dont know how raddock and document container set these tab after closinag application and open it again. i think raddock shuffle these tab and then load them.
can u help me how can i save the layout of my document tabs?

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 04 Oct 2013, 10:32 AM
Hello Saghar,

Thank you for contacting Telerik Support.

To get the correct order of the Tabs you need to get the instance of the RadPageViewElement. The property Items is a ReadOnlyCollection which holds all the tabs in their correct order. Which means that if you create two Tabs - "Tab 1" and "Tab 2", when "Tab 2" is dragged before "Tab 1" the collection's order will also change. With the sample code below you can get the PageViewElement and use your methods for loading/saving the DocumentTabs:
private RadDock dock = new RadDock();
private RadPageViewElement pageView;
 
public Form1()
{
    InitializeComponent();
    this.Controls.Add(this.dock);
 
    for (int i = 0; i < 5; i++)
    {
        this.dock.AddDocument(new DocumentWindow("Doc " + i));
    }
}
 
public void SaveDocumentsToXml()
{
    // Use pageView.Items
}
 
public void LoadDocumentsFromXml()
{
}
 
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    foreach (Control child in ControlHelper.EnumChildControls(this.dock, true))
    {
        DocumentTabStrip docStrip = child as DocumentTabStrip;
        if (docStrip != null)
        {
            RadPageViewElement pageViewElement = docStrip.TabStripElement;
            this.pageView = pageViewElement;
            break;
        }
    }
}

I hope this information is helpful. Let me know if you require additional assistance.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Saghar
Top achievements
Rank 1
answered on 05 Oct 2013, 12:13 PM
Hello,
Thank you for your reply, it was useful, but i have 2 problem with this code:
i have attach my error.
my another problem is that how i can use of RadPageViewElement.
 i know my question is so easy but i am new to these controls.
thanks for your attention,

0
George
Telerik team
answered on 09 Oct 2013, 02:13 PM
Hello Saghar,

Thank you for writing back.

In version 2013 Q2 724 the property TabStripElement is of type RadPageViewStripElement which inherits from RadPageViewElement which should not be a problem. However my assumption here is that you are using an earlier version of our controls. If that is the case I would recommend you to upgrade to the latest release.

Let me know If I can be of further assistance.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Dock
Asked by
Saghar
Top achievements
Rank 1
Answers by
George
Telerik team
Saghar
Top achievements
Rank 1
Share this question
or