ExtensionsFactory.TreeList<RowType>(Action<TreeListSettings<RowType>>) Method

Creates a TreeList.

Namespace: DevExpress.Web.Mvc.UI

Assembly: DevExpress.Web.Mvc5.v20.2.dll


public TreeListExtension<RowType> TreeList<RowType>(
    Action<TreeListSettings<RowType>> method
    where RowType : class
Public Function TreeList(Of RowType As Class)(
    method As Action(Of TreeListSettings(Of RowType))
) As TreeListExtension(Of RowType)


Name Type Description
method Action<TreeListSettings<RowType>>

A delegate method that accepts TreeListSettings<RowType> as a parameter.

Type Parameters



Type Description

A TreeListExtension<RowType> object implementing the TreeList functionality.


To enable binding TreeList columns to Model fields using lambdas, it is required to declare the TreeList extension using the TreeList<RowType> strongly-typed declaration method.


The partial View with the TreeList extension does not need to be strongly-typed.

The code example below demonstrates how to declare the strongly-typed TreeList with columns bound to data model fields via lambda expressions.

    // TreeList displays instances of the EditablePost class.
    Html.DevExpress().TreeList<EditablePost>(settings => {
        settings.Name = "treeList";
        settings.CallbackRouteValues = new { Controller = "Home", Action = "TreeListPartial" };

        settings.KeyField(m => m.PostID);
        settings.ParentField(m => m.ParentID);

        // The following columns are bound to Model fields via lambdas.
        settings.Columns.Add(m => m.From);
        settings.Columns.Add(m => m.Subject);
        settings.Columns.Add(m => m.PostDate);
        settings.Columns.Add(m => m.IsNew, c => c.ColumnType = MVCxTreeListColumnType.CheckBox);
        settings.Columns.Add(m => m.HasAttachment, c => c.ColumnType = MVCxTreeListColumnType.CheckBox);
See Also