Check RadTreeNode check box without effecting selection

2 posts, 0 answers
  1. Travis
    Travis avatar
    49 posts
    Member since:
    Dec 2012

    Posted 28 May 2013 Link to this post

    Is there a way to check or uncheck a RadTreeNode checkbox without effecting the selection? For our app, it's kind of handy that we can do both, but it's also useful that we check or uncheck without impacting the selection. Or possibly vice versa (current behavior) might be acceptable. In either case, ????
  2. Stefan
    Stefan avatar
    2911 posts

    Posted 31 May 2013 Link to this post

    Hi Michael,

    Thank you for writing.

    To do that, you can inherit from RadTreeView and override the OnMouseDown method, where you can save the SelectedNode prior the base call and restore it right after. Here is an example:
    class MyTreeView : RadTreeView
        protected override void OnMouseDown(MouseEventArgs e)
            TreeNodeCheckBoxElement element = this.ElementTree.GetElementAtPoint(e.Location) as TreeNodeCheckBoxElement;
            if (element != null)
                RadTreeNode saveSelectedNode = this.SelectedNode;
                this.SelectedNode = saveSelectedNode;
        public override string ThemeClassName
                return typeof(RadTreeView).FullName;

    I hope this helps.

    RadChart for WinForms is obsolete. Now what?
Back to Top