Clicked on the group header and collapsed group

2 posts, 0 answers
  1. Elena
    Elena avatar
    5 posts
    Member since:
    Feb 2015

    Posted 26 Mar 2015 Link to this post


    Sometimes unintentionally clicked on the group header and collapsed group, How can prevent collapsed group ? or collapse like expander if clicked on the button expand or collapse?
  2. Maya
    Maya avatar
    4062 posts

    Posted 30 Mar 2015 Link to this post

    Hello Elena,

    Generally, the whole element is a RadToggleButton which will be checked/unchecked no matter where exactly on it you have clicked. What you can try is to verify the exact place and cancel the bubbling of the mouse event. For example:
    public MainWindow()
               this.AddHandler(RadToggleButton.PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(OnPreviewMouseLeftButtonDown), true);
           private void OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
               var element = e.OriginalSource as FrameworkElement;
               var toggleButton = element.ParentOfType<RadToggleButton>();
               if (toggleButton != null && element.Name != "IconInnerBorder")
                   e.Handled = true;


    See What's Next in App Development. Register for TelerikNEXT.

  3. DevCraft R3 2016 release webinar banner
Back to Top