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

Selection Changed

1 Answer 59 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Frédéric
Top achievements
Rank 1
Frédéric asked on 02 Oct 2008, 01:33 PM

Hi,

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,

Fred

 

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 03 Oct 2008, 12:00 PM
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,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Treeview
Asked by
Frédéric
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or