A newer version of this page is available. Switch to the current version.

TreeList Class

Displays data as a multi-column tree view. Can be used in either bound or unbound mode. See Tree List for more information.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v18.2.dll

Declaration

[Docking(DockingBehavior.Ask)]
[TreeList.TreeListCustomBindingProperties]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "TreeList")]
public class TreeList :
    EditorContainer,
    IDirectXClient,
    ISupportAsyncScrollAnimation,
    ISupportExpandAnimation,
    ISupportXtraAnimation,
    IControlRowSource,
    IFilteringUIClient,
    IFilterCriteriaBindingAware,
    IPrintableEx,
    IPrintable,
    IBasePrintable,
    IXtraSerializable,
    INavigatableControl,
    IToolTipControlClient,
    IAppearanceOwner,
    ISupportLookAndFeel,
    IDXManagerPopupMenu,
    IAccessibleGrid,
    IXtraSerializableLayout,
    IEvaluatorDataAccess,
    IXtraSerializableLayoutEx,
    ISupportXtraSerializer,
    IGestureClient,
    IServiceProvider,
    IStringImageProvider,
    IFilteredComponent,
    IFilteredComponentBase,
    ISearchControlColumnsClient,
    ISearchControlClient,
    IOptionsLayoutProvider,
    IXtraSerializableLayout2,
    ISupportDesignMode
<Docking(DockingBehavior.Ask)>
<TreeList.TreeListCustomBindingProperties>
<ToolboxBitmap(GetType(ToolboxIconsRootNS), "TreeList")>
Public Class TreeList
    Inherits EditorContainer
    Implements IDirectXClient,
               ISupportAsyncScrollAnimation,
               ISupportExpandAnimation,
               ISupportXtraAnimation,
               IControlRowSource,
               IFilteringUIClient,
               IFilterCriteriaBindingAware,
               IPrintableEx,
               IPrintable,
               IBasePrintable,
               IXtraSerializable,
               INavigatableControl,
               IToolTipControlClient,
               IAppearanceOwner,
               ISupportLookAndFeel,
               IDXManagerPopupMenu,
               IAccessibleGrid,
               IXtraSerializableLayout,
               IEvaluatorDataAccess,
               IXtraSerializableLayoutEx,
               ISupportXtraSerializer,
               IGestureClient,
               IServiceProvider,
               IStringImageProvider,
               IFilteredComponent,
               IFilteredComponentBase,
               ISearchControlColumnsClient,
               ISearchControlClient,
               IOptionsLayoutProvider,
               IXtraSerializableLayout2,
               ISupportDesignMode

Remarks

The Tree List displays data with parent-child relations as 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. A data source must contain two fields that provide information on parent-child relationships between records: a unique record ID (key), and a parent record ID. These fields must be assigned to the TreeList.KeyFieldName and TreeList.ParentFieldName properties.

In unbound mode, you need to manually populate the TreeList with nodes manually. You can either create all nodes at once, or start with root nodes only to provide child nodes on demand. See Unbound Mode for more information.

Main TreeList features are:

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

The collection of root level nodes is stored in the TreeList.Nodes property. 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.

See Also