Skip to main content
A newer version of this page is available. .

TcxCustomTreeView Class

Serves as the base for tree view controls.

Declaration

TcxCustomTreeView = class(
    TcxTreeViewContainer
)

Remarks

The TcxCustomTreeView class implements the basic functionality of tree view controls. These controls display a set of items arranged as a tree. This implies that each item in the control can have children. Parent items can be expanded and collapsed to show and hide children.

Please refer to the Items property for details on how to create a tree-like structure. The item structure can be loaded from a text file or a stream. Refer to the LoadFromFile and LoadFromStream methods for details. You can also save the item structure by using the SaveToFile and SaveToStream methods.

Items of TcxCustomTreeView descendant controls are represented by TTreeNode objects. Visually, items are comprised of text labels and images. If this visual representation does not suit your application’s needs, you can paint items manually by handling the OnCustomDrawItem and OnAdvancedCustomDrawItem events. Additionally you can create your own TTreeNode class descendant to represent nodes within the control. You must handle the OnCreateNodeClass event to perform the replacement.

In addition to painting individual items, you can paint the entire tree view control manually. This can be performed by handling the OnCustomDraw and OnAdvancedCustomDraw events.

Two more significant features implemented by the TcxCustomTreeView class are multi selection of items and item sorting. Please refer to the MultiSelect and SortType property descriptions for details.

Note that the TcxCustomTreeView control uses the underlying TCustomTreeView object to perform most of its tasks. Many settings are very similar to those of the standard tree view. The primary difference is that the TcxCustomTreeView, like all of the controls within the ExpressEditors library, fully supports our style technology. Please refer to the Style, StyleDisabled, StyleFocused and StyleHot properties for details.

Do not create instances of the TcxCustomTreeView class. Use the derived TcxTreeView control if you need to use a tree view within your application. The TcxCustomTreeView class can be used as the base when creating your own controls that require tree view functionality.

See Also