raddock document tab order

4 posts, 0 answers
  1. Saghar
    Saghar avatar
    2 posts
    Member since:
    Oct 2013

    Posted 01 Oct 2013 Link to this post

    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?
  2. George
    Admin
    George avatar
    500 posts

    Posted 04 Oct 2013 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Saghar
    Saghar avatar
    2 posts
    Member since:
    Oct 2013

    Posted 05 Oct 2013 Link to this post

    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,

  5. George
    Admin
    George avatar
    500 posts

    Posted 09 Oct 2013 Link to this post

    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 >>
Back to Top