New to Telerik UI for ASP.NET Core? Start a free 30-day trial
ASP.NET Core TreeList Overview
The Telerik UI TreeList TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI TreeList widget.
The TreeList enables the display of self-referencing tabular data and allows sorting, filtering, and data editing.
Initializing the TreeList
The following example demonstrates how to define the TreeList.
The TreeList distinguishes the root items based on the
ParentId
field. If theParentId
is set as.Nullable(true)
, root items with be items whoseParentId
field values arenull
. If theParentId
is not nullable (.Nullable(false)
), root items will be items which have a default value for their data type.
Razor
@(Html.Kendo().TreeList<Kendo.Mvc.Examples.Models.TreeList.EmployeeDirectoryModel>()
.Name("treelist")
.Columns(columns =>
{
columns.Add().Field(f => f.FirstName).Width(250).Title("First Name");
columns.Add().Field(e => e.LastName).Title("Last Name");
columns.Add().Field(e => e.Position);
columns.Add().Field(e => e.Extension).Title("Ext").Format("{0:#}");
})
.DataSource(dataSource => dataSource
.Read(read => read.Action("Index", "EmployeeDirectory"))
.Model(m => {
m.Id(f => f.EmployeeId);
m.ParentId(f => f.ReportsTo).Nullable(true);
m.Field(f => f.FirstName);
m.Field(f => f.LastName);
m.Field(f => f.ReportsTo);
})
)
)
Functionality and Features
Feature | Description |
---|---|
Ajax binding | You can bind the TreeList to remote data. |
Editing | The TreeList supports various editing modes that allow you to control the way the data is represented. |
Paging | Use the built-in paging functionality to paginate the data. |
Grouping with aggregates | The TreeList allows you to display built-in aggregate calculations, when the supplied data is grouped. |
Excel | The control enables you to export its content to Excel. |
You can export the content of the TreeList to PDF with this built-in functionality. | |
Column enhancements | The TreeList allows you to set locked (frozen) columns, which remain visible while you scroll the TreeList horizontally. |
Scrolling | You can independently control vertical and horizontal scrolling in the component. |
Row Selection | The TreeList supports different modes of row selection. |
Localization | The control provides localization of its messages. |
Accessibility | The TreeList is accessible for screen readers, supports WAI-ARIA attributes, and delivers keyboard shortcuts for faster navigation. |
Next Steps
-
Basic Usage of the TreeList HtmlHelper for ASP.NET Core (Demo)
-
Basic Usage of the TreeList TagHelper for ASP.NET Core (Demo)