Back to Devexpress

Obtain Nodes

wpf-9613-controls-and-libraries-data-grid-grid-view-data-layout-nodes-obtain-nodes.md

latest2.5 KB
Original Source

Obtain Nodes

  • Apr 01, 2021
  • 2 minutes to read

A node can be identified by its key value (only in bound mode), content, row handle or visible index. The table below lists methods allowing you to obtain a node by its identifiers.

Property/MethodDescription
TreeListView.FocusedNodeGets the focused node.
TreeListView.GetNodeByKeyValueSearches for a node with the specified key value (only in bound mode).
TreeListView.GetNodeByCellValueSearches for the first found node with the specified value within the specified column.
TreeListView.GetNodeByContentSearches for a node with the specified content. A node’s content is specified by the TreeListNodeBase.Content property.
TreeListView.GetNodeByRowHandleSearches for a node with the specified row handle. A node’s row handle is specified by the TreeListNodeBase.RowHandle property.
TreeListView.GetNodeVisibleIndexSearches for a visible node displayed at the specified position among other visible nodes.

Row Handles and Visible Indices

A row handle is an integer value that identifies a node regardless of whether it is displayed within a View. A visible index is an integer value that identifies only a visible node. If a node is hidden within a collapsed node, its visible index is always -1.

The following images illustrate the difference between row handles and visible indices.

  • All nodes are expanded.

  • One node is collapsed.

Use the TreeListView.GetNodeVisibleIndex method to get the specified node’s visible index.

See Also

Iterate Through Nodes

Bind to Self-Referential Data Structure