Node Selection

When you click on a node at run time it is automatically marked as selected. Clicking a node will raise the SelectionChanged event to provide custom functionality. To have the nodes marked as selected without clicking them you can enable the IsSelected property.

When the user selects a new item, the C1TreeView fires the SelectionChanged event. You can then retrieve the item that was selected using the SelectedItem property.

There're several ways to do this. One is to assign additional data to the Tag property of each C1TreeViewItem as you create them. Later, you can inspect the Tag property to retrieve the information. For example:

      Visual Basic

      C#

Later, use the information in whatever way you see fit:

      Visual Basic

      C#

If the SelectionMode property is set to Multiple then multiple nodes can be selected at one time by holding down the control key while mouse clicking multiple nodes. To unselect a node, click on it again. The nodes are marked as selected in the following C1TreeView:

 


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.