How to change the RadPane's order in RadPaneGroup?

3 posts, 1 answers
  1. Jonathan
    Jonathan avatar
    26 posts
    Member since:
    Jan 2016

    Posted 15 Oct Link to this post

    Hi, I have some RadPanes in a RadPaneGroup, and I want to change one of the RadPane's order,  just like to the first tab position or somewhere. How to do it? 

    Thanks

  2. Answer
    Nasko
    Admin
    Nasko avatar
    586 posts

    Posted 19 Oct Link to this post

    Hello Jonathan,

    From the provided description of your requirement you are trying to change the current position of a Pane from code-behind. RadPanes are placed inside RadPaneGroups which on the other hand derives from ItemsControls. So, in order to change the position of a Pane placed inside the PaneGroup you need to implement some custom logic for the Items collection of the PaneGroup. For example the following code-snippet will move the first to index 1:
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        var itemToMove = paneGroup.Items.GetItemAt(0);
        paneGroup.Items.RemoveAt(0);
        paneGroup.Items.Insert(1, itemToMove);
    }

    Hope the provided information will be helpful for you.

    Regards,
    Nasko
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jonathan
    Jonathan avatar
    26 posts
    Member since:
    Jan 2016

    Posted 22 Oct in reply to Nasko Link to this post

    Thank you Nasko. I use your code and it's well.
Back to Top