aspnet-devexpress-dot-web-dot-mvc-4bd3559f.md
An extension object implementing the TreeList functionality.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v20.1.dll
NuGet Package : DevExpress.Web.Mvc5
public class TreeListExtension :
ExtensionBase
Public Class TreeListExtension
Inherits ExtensionBase
The following members return TreeListExtension objects:
To declare the TreeList in a View, invoke the ExtensionsFactory.TreeList helper method. This method returns the TreeList extension that is implemented by the TreeListExtension class.
To configure the TreeList extension, pass the TreeListSettings object to the ExtensionsFactory.TreeList helper method as a parameter. The TreeListSettings object contains all the TreeList extension settings.
@Html.DevExpress().TreeList(settings => {
settings.Name = "treeList";
settings.CallbackRouteValues = new { Controller = "Editing", Action = "BatchEditingPartial" };
settings.SettingsEditing.BatchUpdateRouteValues = new { Controller = "Editing", Action = "BatchEditingUpdateModel" };
settings.SettingsEditing.Mode = TreeListEditMode.Batch;
settings.Columns.Add("From");
settings.Columns.Add("Subject");
settings.Columns.Add(c => {
c.FieldName = "PostDate";
c.Caption = "Date";
c.EditorProperties().DateEdit(p => {
p.DisplayFormatString = "dd/MM/yyyy hh:mm tt";
p.DisplayFormatInEditMode = true;
p.EditFormat = EditFormat.DateTime;
});
});
settings.Columns.Add(c => {
c.FieldName = "IsNew";
c.ColumnType = MVCxTreeListColumnType.CheckBox;
c.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
});
...
}).SetEditErrorText(ViewData["EditNodeError"] as string).Bind(Model).GetHtml()
Object ExtensionBase TreeListExtension TreeListExtension<RowType>
See Also