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
Related API Members
The following members return TreeList objects:
Remarks
The Tree List displays data with parent-child relations as nodes organized into a hierarchy.
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:
- Multiple columns.
- Sorting data against any number of columns.
- Summaries.
- Preview sections.
- Multiple ways to filter data - Microsoft Excel Style Filter Dropdowns, Auto Filter Row, Advanced Filter Editor, filters created in code, Find Panel, etc.
- Multiple cell in-place editors.
- Node images.
- Runtime column customization
- Column formats and summary values.
- Look-and-feel customization - Support for multiple paint schemes (skins, Flat, UltraFlat, etc.).
- Appearance customization.
- Breadcrumb Navigation
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.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.