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

How to change the RadPane's order in RadPaneGroup?

2 Answers 123 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 15 Oct 2016, 06:20 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 19 Oct 2016, 10:57 AM
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.
0
Jonathan
Top achievements
Rank 1
answered on 22 Oct 2016, 10:59 AM
Thank you Nasko. I use your code and it's well.
Tags
Docking
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or