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

4 posts, 0 answers
  1. Adrian
    Adrian avatar
    10 posts
    Member since:
    Jun 2013

    Posted 12 Jun 2014 Link to this post

    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.
  2. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 13 Jun 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Adrian
    Adrian avatar
    10 posts
    Member since:
    Jun 2013

    Posted 13 Jun 2014 in reply to Kalin Link to this post

    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
  5. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 13 Jun 2014 Link to this post

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