Back to Devexpress

TreeList.FocusedNodeChanged Event

windowsforms-devexpress-dot-xtratreelist-dot-treelist-55a6ba83.md

latest7.9 KB
Original Source

TreeList.FocusedNodeChanged Event

Fires when focus moves from one node to another.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[DXCategory("Property Changed")]
public event FocusedNodeChangedEventHandler FocusedNodeChanged
vb
<DXCategory("Property Changed")>
Public Event FocusedNodeChanged As FocusedNodeChangedEventHandler

Event Data

The FocusedNodeChanged event's data class is FocusedNodeChangedEventArgs. The following properties provide information specific to this event:

PropertyDescription
NodeGets the current Tree List node. Inherited from NodeEventArgs.
OldNodeGets the previously focused Tree List node.

Remarks

The FocusedNodeChanged event fires when focus moves from node to node for the following reasons:

  • A user moves focus to a node.
  • The TreeList.FocusedNode property is changed in code.
  • Focus moves to the added node when you use the TreeList.AppendNode method.
  • Focus moves to the focused node’s parent after the parent node is collapsed.
  • The focused node is removed from the Tree List control.

Handle the TreeList.BeforeFocusNode event to specify whether a particular node can receive focus.

You can use the FocusedRowChanged and TreeList.SelectionChanged events interchangeably in single selection mode (see treeList.OptionsSelection.MultiSelect).

The following code snippets (auto-collected from DevExpress Examples) contain references to the FocusedNodeChanged event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-win-gantt-control/CS/XPO/GanttSolutionXPO/GanttSolutionXPO.Win/Editors/CustomGanttEditor.cs#L90

csharp
control.SelectionChanged += Control_SelectedIndexChanged;
control.FocusedNodeChanged += Control_FocusedNodeChanged;
control.MouseDoubleClick += Control_MouseDoubleClick;

winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/Form1.cs#L148

csharp
treeList.OptionsPrint.UsePrintStyles = true;
treeList.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(this.OnNewExampleSelected);
treeList.OptionsView.ShowColumns = false;

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/Form1.cs#L136

csharp
treeList.OptionsPrint.UsePrintStyles = true;
treeList.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(this.OnNewExampleSelected);
treeList.OptionsView.ShowColumns = false;

winforms-spreadsheetcontrol-api-part-3/CS/SpreadsheetControl_API_Part03/Form1.cs#L311

csharp
treeList.OptionsPrint.UsePrintStyles = true;
treeList.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(this.OnNewExampleSelected);
treeList.OptionsView.ShowColumns = false;

winforms-richeditcontrol-common-api/CS/RichEditAPISample/Form1.cs#L415

csharp
treeList.OptionsPrint.UsePrintStyles = true;
treeList.FocusedNodeChanged += new DevExpress.XtraTreeList.FocusedNodeChangedEventHandler(this.OnNewExampleSelected);
treeList.OptionsView.ShowColumns = false;

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/Form1.vb#L143

vb
treeList.OptionsPrint.UsePrintStyles = True
AddHandler treeList.FocusedNodeChanged, AddressOf OnNewExampleSelected
treeList.OptionsView.ShowColumns = False

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/Form1.vb#L129

vb
treeList.OptionsPrint.UsePrintStyles = True
AddHandler treeList.FocusedNodeChanged, AddressOf OnNewExampleSelected
treeList.OptionsView.ShowColumns = False

winforms-spreadsheetcontrol-api-part-3/VB/SpreadsheetControl_API_Part03/Form1.vb#L314

vb
treeList.OptionsPrint.UsePrintStyles = True
AddHandler treeList.FocusedNodeChanged, New FocusedNodeChangedEventHandler(AddressOf OnNewExampleSelected)
treeList.OptionsView.ShowColumns = False

winforms-richeditcontrol-common-api/VB/RichEditAPISample/Form1.vb#L407

vb
treeList.OptionsPrint.UsePrintStyles = True
AddHandler treeList.FocusedNodeChanged, AddressOf OnNewExampleSelected
treeList.OptionsView.ShowColumns = False

winforms-richedit-document-api/VB/RichEditAPISample/Form1.vb#L410

vb
treeList.OptionsPrint.UsePrintStyles = True
AddHandler treeList.FocusedNodeChanged, New FocusedNodeChangedEventHandler(AddressOf OnNewExampleSelected)
treeList.OptionsView.ShowColumns = False

See Also

BeforeFocusNode

FocusedNode

SelectionChanged

MultiSelect

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace