Selection Changed

2 posts, 0 answers
  1. Frédéric
    Frédéric avatar
    11 posts
    Member since:
    Jul 2008

    Posted 02 Oct 2008 Link to this post


    Is there an easy way to have a method called every time the selection change (added or removed node) ? A function called SelectionChanged?

    Actually the Selecting event is fired only when node are added. When you use multi select you can remove a node by clicking on it with the CTRL key down. In this case the Selecting event is not fired...

    Do you plan to add this feature in a next release?

    Thanks in advance,

    Best regards,



  2. Jordan
    Jordan avatar
    547 posts

    Posted 03 Oct 2008 Link to this post

    Hi Frédéric,

    Yes, we have planned to add this functionality in the 2008 Q3 release of RadControls for WinForms by making the SelectedNodes collection observable.

    For now you can know when a node is unselected using the CTRL key by handling the NodeMouseDown event like below:
    void radTreeView1_NodeMouseDown(object sender, RadTreeViewMouseEventArgs e) 
                if (this.radTreeView1.AllowMultiselect && Control.ModifierKeys == Keys.Control 
                    && this.radTreeView1.SelectedNodes.Contains(e.Node)) 
                    Console.WriteLine("Node unselected: {0}", e.Node); 

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top