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

RadPane is automatically selected (IsSelected set to true) after adding to RadPaneGroup.Items collection.

3 Answers 93 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 12 Jun 2014, 03:27 PM
RadPane is automatically selected (IsSelected set to true) after adding to RadPaneGroup.Items collection. Can I prevent such behaviour? I would like to add new RadPane to the RadPaneGroup but not change already selected RadPane.

3 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 13 Jun 2014, 07:14 AM
Hi Adrian,

This is the default behavior of the Docking control - when new Pane is added it automatically becomes selected. However if you want to avoid that behavior you would need to manually select the previously selected RadPane when the new one is added.

Hope this will work for you. 

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Adrian
Top achievements
Rank 1
answered on 13 Jun 2014, 12:33 PM
Kalin,

Thank you for response. Unfortunatelly proposed solution is not acceptable because during the selection change there are many things that happen in the code (so I don't want them to happen). However I have found a workaround that suits me:

private void AddFrameToPaneGroup(RadPaneGroup paneGroup, RadPane pane, bool autoSelect)
{
   if (autoSelect || paneGroup.Items.Count == 0)
   {
      paneGroup.Items.Add(pane);
   }
   else
   {
      paneGroup.PreviewSelectionChanged += PreventAutoselect;
      paneGroup.Items.Add(pane);
      paneGroup.PreviewSelectionChanged -= PreventAutoselect;
   }
}
 
private void PreventAutoselect(object sender, RadSelectionChangedEventArgs e)
{
   e.Handled = true;
}

Regards,
Adrian
0
Kalin
Telerik team
answered on 13 Jun 2014, 12:55 PM
Hello Adrian,

Thanks for sharing your solution. If you have any further questions or concerns, please let us know.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Docking
Asked by
Adrian
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Adrian
Top achievements
Rank 1
Share this question
or