Version

Activation (xamDataTree)

The xamDataTree™ control supports activation of its nodes. A node is considered to be active if it is the current node focus. Only one node can be active at any given time. Activation is implemented on the xamDataTree control so that actions that can only be executed on a single node, such as editing, can be performed.

Activation Using the Keyboard

If the xamDataTree control does not have an active item, and the tree receives focus, then the first node in the tree will become active. Once there is an active node in the tree, your end user can navigate through the tree using the arrow keys.

The following table lists all the keys that can be used to interact with the xamDataTree control.

Key Functionality

Up

Moves the active node up

Down

Moves the active node down

Left

Collapse the node if expanded

Right

Expand the node if it has children selecting the Right key again will activate the first child.

Enter

Selects the active node

Space

If check boxes are enabled, this key selects/unselects the check box associated with the active node.

Activation with Code

You can get or set the active node using the xamDataTree control’s ActiveNode property, as demonstrated by the following code snippet.

In Visual Basic:

MyTree.ActiveNode = MyTree.Nodes(0).Nodes(0)

In C#:

MyTree.ActiveNode = MyTree.Nodes[0].Nodes[0];

You can also set an active node using the Node’s IsActive property. The following code demonstrates how to achieve this.

In Visual Basic:

MyTree.Nodes(0).Nodes(0).IsActive = True

In C#:

MyTree.Nodes[0].Nodes[0].IsActive = true;

Related Topics