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

TreeList Class

Displays data as a multi-column tree view. Can be used in either bound or unbound mode, with full support for data editing, validation, summaries, etc. See Tree List.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v18.1.dll

Declaration

[ToolboxTabName("DX.18.1: Data & Analytics")]
[TreeList.TreeListCustomBindingProperties]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "TreeList")]
[Docking(DockingBehavior.Ask)]
[DataAccessMetadata("All", SupportedProcessingModes = "Simple")]
public class TreeList :
    EditorContainer,
    IDirectXClient,
    ISupportAsyncScrollAnimation,
    ISupportExpandAnimation,
    IControlRowSource,
    IFilteringUIClient,
    IFilterCriteriaBindingAware,
    IPrintableEx,
    IPrintable,
    IBasePrintable,
    IXtraSerializable,
    INavigatableControl,
    IToolTipControlClient,
    IAppearanceOwner,
    ISupportLookAndFeel,
    IDXManagerPopupMenu,
    IAccessibleGrid,
    ISupportXtraAnimation,
    IEvaluatorDataAccess,
    IXtraSerializableLayoutEx,
    ISupportXtraSerializer,
    IGestureClient,
    IServiceProvider,
    IStringImageProvider,
    IFilteredComponent,
    IFilteredComponentBase,
    ISearchControlColumnsClient,
    ISearchControlClient,
    IOptionsLayoutProvider,
    IXtraSerializableLayout2,
    IXtraSerializableLayout

Remarks

The Tree List displays nodes organized into a hierarchy.

Tree List - Simple

The control supports bound and unbound modes. In bound mode, data is loaded from an external data source specified by the TreeList.DataSource and TreeList.DataMember properties. The data source must contain two fields that provide information on parent-child relationships between records. These fields need to be assigned to the TreeList.KeyFieldName and TreeList.ParentFieldName properties.

In unbound mode, the TreeList is populated with nodes manually by calling specific node creation methods. You can create all nodes simultaneously, or create only root nodes initially, and then provide child nodes dynamically on demand, by handling an event. See Unbound Mode to learn more.

The following are main features supported by the control:

The column collection can be accessed with the TreeList.Columns property. At design time, you can create columns using the Tree List Designer. See Columns for more information.

The collection of root level nodes can be obtained by reading the TreeList.Nodes property value. Child nodes of each node are stored in the node’s TreeListNode.Nodes collection. See Nodes for information on node objects, node structure and how to iterate through nodes.

Note

If the TreeList control is created at design time, changing the visual settings and size of the control and its elements (e.g., invoking the best fit functionality) is not in effect before the Tree List has completed its initialization. To customize these settings in the form’s System.Windows.Forms.Form.Load event handler, call the TreeList.ForceInitialize method prior to performing additional customization.

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

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