Obtain Nodes

  • 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/Method Description
TreeListView.FocusedNode Gets the focused node.
TreeListView.GetNodeByKeyValue Searches for a node with the specified key value (only in bound mode).
TreeListView.GetNodeByCellValue Searches for the first found node with the specified value within the specified column.
TreeListView.GetNodeByContent Searches for a node with the specified content. A node's content is specified by the TreeListNodeBase.Content property.
TreeListView.GetNodeByRowHandle Searches for a node with the specified row handle. A node's row handle is specified by the TreeListNodeBase.RowHandle property.
TreeListView.GetNodeVisibleIndex Searches 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.

    Row Handle vs Visible Index 1

  • One node is collapsed.

    Row Handle vs Visible Index 2

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

See Also