A newer version of this page is available. Switch to the current version.

TreeList.SelectionChanged Event

Fires in response to changing selection when the TreeList is in multiselect mode.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.2.dll


[DXCategory("Property Changed")]
public event EventHandler SelectionChanged

Event Data

The SelectionChanged event's data class is EventArgs.


The TreeListOptionsSelection.MultiSelect option enables you to switch the TreeList control to multiselect mode. If this option is enabled, the TreeList allows you to select multiple nodes. The SelectionChanged event fires each time a node is selected or deselected in such a case.

Write a SelectionChanged event handler to perform specific actions each time a node is either selected or deselected. this can be useful if you want to maintain an up-to-date list of selected nodes, for instance.

If the multiselect feature is disabled, use the TreeList.FocusedNodeChanged event to respond to changes in the selected node.


The following sample code displays the number of currently selected nodes in a status bar. The TreeList.SelectionChanged event is used to respond to changing the selection.

Selections - Changed

using DevExpress.XtraTreeList;

private void treeList1_SelectionChanged(object sender, EventArgs e) {
    string s = (sender as TreeList).Selection.Count.ToString() + " node(s) selected";
    barStaticItem1.Caption = s;
See Also