Skip to main content

TreeList.FocusedNode Property

Gets or sets the focused node.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v23.2.dll

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

Declaration

[Browsable(false)]
public TreeListNode FocusedNode { get; set; }

Property Value

Type Description
TreeListNode

A TreeListNode object representing the focused node. null (Nothing in Visual Basic) if no node is focused.

Remarks

The FocusedNode property allows you to determine the currently focused node or to move node focus. Note also that assigning an existing node to the FocusedNode property makes the specified node visible on screen. This may result in scrolling and expanding collapsed parent nodes.

When node focus changes, the TreeList.FocusedNodeChanged event is raised.

If you assign an invisible node (TreeListNode.Visible) to the FocusedNode property, the property resets to the null value.

Example

The following example shows how to move focus to a specific node. To do this, the requried node is assigned to the TreeList.FocusedNode property.

// Move focus to the first root node.
treeList1.FocusedNode = treeList1.Nodes[0];

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

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.

See Also