Treeview Control

A TreeView control displays items in a hierarchical display. Each item, called a node, may contain parent or child items, and may be expanded or collapsed via a mouse click.

Client support

Newlook Smartclient only.

Use

This control is useful for displaying data which is hierarchical in nature. It allows users to expand only the information that they need to see. Tree view nodes can also be displayed with check boxes which makes it possible to programmatically select or clear nodes by setting the Node's Checked property to true or false.

After inserting a tree view control in Designer, you can add, remove or reorganize Node objects by setting the relevant properties in Designer or invoking the relevant methods via a script.

The key property of the TreeView control is the Nodes property. It contains an array of nodes for the control. Icons can be displayed next to nodes by associating an image list control with the tree view's Icons property. Specific icons can then be assigned to individual nodes via the Icon and SelectedIcon property.

At runtime it is possible to return the node that the user has clicked via the LastClickedNode property.

Material skin considerations

When the material skin is enabled in your solution, tree view controls will be rendered with material styling. The most noticeable difference is a cleaner appearance, no borders and more spacing within the tree. If you have checkboxes enabled, then they will be rendered with the material primary color in the selected state.

Material skin

Classic skin

See Also

Node object | Nodes collection | ListView control


© 2004-2021 looksoftware. All rights reserved.