New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent API for configuring the Kendo TreeList for ASP.NET MVC.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class TreeListBuilder<T> : WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>, IHtmlString where T : class

Inheritance: objectWidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>TreeListBuilder<T>

Implements: IHtmlString

Inherited Members WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.ToComponent()WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.Name(string)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.Deferred(bool)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.ModelMetadata(ModelMetadata)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.HtmlAttributes(object)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.AsModule(bool)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.Render()WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.ScriptAttributes(object, bool)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.ToHtmlString()WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.ToClientTemplate()WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.ToString()WidgetBuilderBase<TreeList<T>, TreeListBuilder<T>>.Componentobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the TreeList<T> class.

C#
public TreeListBuilder(TreeList<T> component)
Parameters:componentTreeList<T>

The component.

Methods

The template which renders the alternating table rows. By default the treelist renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> AltRowTemplate(string value)
Parameters:valuestring

The value that configures the altrowtemplate.

Returns:

TreeListBuilder<T>

The template which renders the alternating table rows. By default the treelist renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> AltRowTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the altrowtemplate.

Returns:

TreeListBuilder<T>

The template which renders the alternating table rows. By default the treelist renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> AltRowTemplateHandler(string value)
Parameters:valuestring

The value that configures the altrowtemplate.

Returns:

TreeListBuilder<T>

The template which renders the alternating table rows. By default the treelist renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> AltRowTemplateId(string value)
Parameters:valuestring

The value that configures the altrowtemplate.

Returns:

TreeListBuilder<T>

The template which renders the alternating table rows. By default the treelist renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> AltRowTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the altrowtemplate.

Returns:

TreeListBuilder<T>

If set to false, the TreeList will not bind to the specified DataSource during initialization. In this case, data binding will occur when the change event of the DataSource fires. By default, the TreeList will bind to the DataSource that is specified in the configuration.

C#
public TreeListBuilder<T> AutoBind(bool value)
Parameters:valuebool

The value that configures the autobind.

Returns:

TreeListBuilder<T>

Binds the grid to a list of objects

C#
public TreeListBuilder<T> BindTo(IEnumerable<T> dataSource)
Parameters:dataSourceIEnumerable<T>

The data source.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;ProductViewModel&gt;()
.Name("treelist")
.BindTo(dataSource)
)

If set to true, the TreeList displays the column menu when the user clicks the Chevron icon in the column headers. The column menu allows the user to show and hide columns, and, if filtering and sorting are enabled, filter and sort the data. By default, the column menu is disabled. Can be set to a JavaScript object which represents the column menu configuration.

C#
public TreeListBuilder<T> ColumnMenu()
Returns:

TreeListBuilder<T>

If set to true, the TreeList displays the column menu when the user clicks the Chevron icon in the column headers. The column menu allows the user to show and hide columns, and, if filtering and sorting are enabled, filter and sort the data. By default, the column menu is disabled. Can be set to a JavaScript object which represents the column menu configuration.

C#
public TreeListBuilder<T> ColumnMenu(Action<TreeListColumnMenuSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListColumnMenuSettingsBuilder<T>>

The action that configures the columnmenu.

Returns:

TreeListBuilder<T>

If set to true, the TreeList displays the column menu when the user clicks the Chevron icon in the column headers. The column menu allows the user to show and hide columns, and, if filtering and sorting are enabled, filter and sort the data. By default, the column menu is disabled. Can be set to a JavaScript object which represents the column menu configuration.

C#
public TreeListBuilder<T> ColumnMenu(bool enabled)
Parameters:enabledbool

Enables or disables the columnmenu option.

Returns:

TreeListBuilder<T>

The configuration of the TreeList columns whcih represents an array of JavaScript objects or strings. JavaScript objects are interpreted as column configurations. Strings are interpreted as thefield to which the column is bound. The TreeList will create a column for each item of the array.

C#
public TreeListBuilder<T> Columns(Action<TreeListColumnFactory<T>> configurator)
Parameters:configuratorAction<TreeListColumnFactory<T>>

The action that configures the columns.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;UserViewModel&gt;()
.Name("treelist")
.Columns(columns =&gt;
{
columns.Add();
})
)

Configure the DataSource of the component

C#
public TreeListBuilder<T> DataSource(Action<TreeListAjaxDataSourceBuilder<T>> configurator)
Parameters:configuratorAction<TreeListAjaxDataSourceBuilder<T>>

The action that configures the DataSource.

Returns:

TreeListBuilder<T>

Example:
C#
@( Html.Kendo().TreeMap()
.Name("treeMap")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read
.Action("_PopulationUS", "TreeMap")
)
)
)

Binds the TreeList to an existing DataSource instance.

C#
public TreeListBuilder<T> DataSource(string dataSourceId)
Parameters:dataSourceIdstring

The name of the client DataSource instance.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().DataSource&lt;ProductViewModel&gt;()
.Name("dataSource1")
.Ajax(dataSource =&gt; dataSource
.PageSize(10)
.Read(read =&gt; read.Action("Products_Read", "DataSource"))
)
)
@(Html.Kendo().TreeList&lt;ProductViewModel&gt;()
.Name("TreeList")
.DataSource("dataSource1")
)

If set to true, the user will be able to edit the data to which the TreeList is bound. By default, editing is disabled. can be set to a JavaScript object (which represents the editing configuration) or to a string (which specifies the edit mode).The supported string values are: (Default) inline; popup or incell.

C#
public TreeListBuilder<T> Editable()
Returns:

TreeListBuilder<T>

If set to true, the user will be able to edit the data to which the TreeList is bound. By default, editing is disabled. can be set to a JavaScript object (which represents the editing configuration) or to a string (which specifies the edit mode).The supported string values are: (Default) inline; popup or incell.

C#
public TreeListBuilder<T> Editable(Action<TreeListEditableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListEditableSettingsBuilder<T>>

The action that configures the editable.

Returns:

TreeListBuilder<T>

If set to true, the user will be able to edit the data to which the TreeList is bound. By default, editing is disabled. can be set to a JavaScript object (which represents the editing configuration) or to a string (which specifies the edit mode).The supported string values are: (Default) inline; popup or incell.

C#
public TreeListBuilder<T> Editable(bool enabled)
Parameters:enabledbool

Enables or disables the editable option.

Returns:

TreeListBuilder<T>

Configures the client-side events.

C#
public TreeListBuilder<T> Events(Action<TreeListEventBuilder> configurator)
Parameters:configuratorAction<TreeListEventBuilder>

The client events action.

Returns:

TreeListBuilder<T>

Example:
C#
@( Html.Kendo().TreeList&lt;ProductViewModel&gt;()
.Name("TreeList")
.Events(events =&gt; events
.DataBinding("onDataBinding")
)
)

Configures the Excel export settings of the TreeList.

C#
public TreeListBuilder<T> Excel(Action<TreeListExcelSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListExcelSettingsBuilder<T>>

The action that configures the excel.

Returns:

TreeListBuilder<T>

If set to true, the user can filter the data source by using the TreeList filter menu. By default, filtering is disabled. Can be set to a JavaScript object which represents the filter menu configuration.

C#
public TreeListBuilder<T> Filterable()
Returns:

TreeListBuilder<T>

If set to true, the user can filter the data source by using the TreeList filter menu. By default, filtering is disabled. Can be set to a JavaScript object which represents the filter menu configuration.

C#
public TreeListBuilder<T> Filterable(Action<TreeListFilterableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListFilterableSettingsBuilder<T>>

The action that configures the filterable.

Returns:

TreeListBuilder<T>

If set to true, the user can filter the data source by using the TreeList filter menu. By default, filtering is disabled. Can be set to a JavaScript object which represents the filter menu configuration.

C#
public TreeListBuilder<T> Filterable(bool enabled)
Parameters:enabledbool

Enables or disables the filterable option.

Returns:

TreeListBuilder<T>

The height of the TreeList. Numeric values are treated as pixels.

C#
public TreeListBuilder<T> Height(double value)
Parameters:valuedouble

The value that configures the height.

Returns:

TreeListBuilder<T>

Defines the text of the command buttons that are shown within the TreeList. Used primarily for localization.

C#
public TreeListBuilder<T> Messages(Action<TreeListMessagesSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListMessagesSettingsBuilder<T>>

The action that configures the messages.

Returns:

TreeListBuilder<T>

If set to true the use could navigate the component using the keyboard navigation. By default keyboard navigation is disabled.

C#
public TreeListBuilder<T> Navigatable()
Returns:

TreeListBuilder<T>

Example:
C#
@( Html.Kendo().TreeList&lt;UserViewModel&gt;()
.Name("treeList")
.Navigatable()
)

If set to true, the user can navigate the widget with the keyboard. By default, keyboard navigation is disabled. For a runnable example, refer to the demo on keyboard navigation in the TreeList.

C#
public TreeListBuilder<T> Navigatable(bool value)
Parameters:valuebool

The value that configures the navigatable.

Returns:

TreeListBuilder<T>

Example:
C#
@( Html.Kendo().TreeList&lt;UserViewModel&gt;()
.Name("treeList")
.Navigatable()
)
C#
public TreeListBuilder<T> Pageable()
Returns:

TreeListBuilder<T>

C#
public TreeListBuilder<T> Pageable(Action<TreeListPageableSettingsBuilder> configurator)
Parameters:configuratorAction<TreeListPageableSettingsBuilder>Returns:

TreeListBuilder<T>

C#
public TreeListBuilder<T> Pageable(bool enabled)
Parameters:enabledboolReturns:

TreeListBuilder<T>

Configures the PDF export settings of the TreeList.

C#
public TreeListBuilder<T> Pdf(Action<TreeListPdfSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListPdfSettingsBuilder<T>>

The action that configures the pdf.

Returns:

TreeListBuilder<T>

If set to true, the user can reorder the columns by dragging their header cells. By default, reordering is disabled.

C#
public TreeListBuilder<T> Reorderable(bool value)
Parameters:valuebool

The value that configures the reorderable.

Returns:

TreeListBuilder<T>

If set to true, the user can resize columns by dragging their header borders. By default, resizing is disabled.

C#
public TreeListBuilder<T> Resizable(bool value)
Parameters:valuebool

The value that configures the resizable.

Returns:

TreeListBuilder<T>

The template which renders rows. By default renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> RowTemplate(string value)
Parameters:valuestring

The value that configures the rowtemplate.

Returns:

TreeListBuilder<T>

The template which renders rows. By default renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> RowTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the rowtemplate.

Returns:

TreeListBuilder<T>

The template which renders rows. By default renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> RowTemplateHandler(string value)
Parameters:valuestring

The value that configures the rowtemplate.

Returns:

TreeListBuilder<T>

The template which renders rows. By default renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> RowTemplateId(string value)
Parameters:valuestring

The value that configures the rowtemplate.

Returns:

TreeListBuilder<T>

The template which renders rows. By default renders a table row (<tr>) for every data source item.

C#
public TreeListBuilder<T> RowTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the rowtemplate.

Returns:

TreeListBuilder<T>

If set to true, the TreeList will display a scrollbar when the total row height or width exceeds the TreeList height or width. By default, scrolling is enabled. Scrolling renders separate tables for the header and data area. For accessibility-conscious applications, disable scrolling.

C#
public TreeListBuilder<T> Scrollable(bool value)
Parameters:valuebool

The value that configures the scrollable.

Returns:

TreeListBuilder<T>

Configures the Kendo UI TreeList search bar settings.

C#
public TreeListBuilder<T> Search(Action<TreeListSearchSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListSearchSettingsBuilder<T>>

The action that configures the search.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;UserViewModel&gt;()
.Name("treelist")
.ToolBar(t =&gt; t.Search())
.Search(s =&gt; s.Field(c =&gt; c.LastName))
)

Specifies whether TreeList selection is allowed. By default selection is disabled

C#
public TreeListBuilder<T> Selectable()
Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;UserViewModel&gt;()
.Name("treelist")
.Selectable()
)

Specifies whether TreeList selection is allowed. By default selection is disabled

C#
public TreeListBuilder<T> Selectable(Action<TreeListSelectableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListSelectableSettingsBuilder<T>>

The configurator for the selectable setting.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;UserViewModel&gt;()
.Name("treelist")
.Selectable(s =&gt; s.Mode(TreeListSelectionMode.Multiple))
)

If set to true the user would be able to select treelist rows. By default selection is disabled.Can also be set to the following string values:

C#
public TreeListBuilder<T> Selectable(bool value)
Parameters:valuebool

The value that configures the selectable.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;UserViewModel&gt;()
.Name("treelist")
.Selectable(true)
)

If set to true, the user is able to sort the TreeList by clicking the column header cells. By default, sorting is disabled. Can be set to a JavaScript object which represents the sorting configuration.

C#
public TreeListBuilder<T> Sortable()
Returns:

TreeListBuilder<T>

If set to true, the user is able to sort the TreeList by clicking the column header cells. By default, sorting is disabled. Can be set to a JavaScript object which represents the sorting configuration.

C#
public TreeListBuilder<T> Sortable(Action<TreeListSortableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListSortableSettingsBuilder<T>>

The action that configures the sortable.

Returns:

TreeListBuilder<T>

If set to true, the user is able to sort the TreeList by clicking the column header cells. By default, sorting is disabled. Can be set to a JavaScript object which represents the sorting configuration.

C#
public TreeListBuilder<T> Sortable(bool enabled)
Parameters:enabledbool

Enables or disables the sortable option.

Returns:

TreeListBuilder<T>

If a String value is assigned to the toolbar configuration option, it will be treated as a single string template for the whole TreeList toolbar and the string value will be passed as an argument to a kendo.template() function.; If a Function value is assigned (it may be a kendo.template() function call or a generic function reference), then the return value of the function will be used to render the contents of the TreeList toolbar.; If an Array value is assigned, it will be treated as the list of commands which are displayed in the TreeList toolbar. Commands can be custom or built-in. The supported built-in commands are:create - Adds an empty data item to the treelist.excel - Exports the TreeList data in MS Excel format.pdf - Exports the TreeList data in PDF format.search - built-in search panel for the TreeList. or If an Object value is assigned, it will propagate these properties to the underlying Toolbar:items - an array of commands as explained aboveoverflow - an object that configures the overflow behavior of the toolbar. The same as Toolbar.overflow property.

C#
public TreeListBuilder<T> Toolbar(Action<TreeListToolbarFactory<T>> configurator)
Parameters:configuratorAction<TreeListToolbarFactory<T>>

The action that configures the toolbar.

Returns:

TreeListBuilder<T>

If a String value is assigned to the toolbar configuration option, it will be treated as a single string template for the whole TreeList toolbar and the string value will be passed as an argument to a kendo.template() function.; If a Function value is assigned (it may be a kendo.template() function call or a generic function reference), then the return value of the function will be used to render the contents of the TreeList toolbar.; If an Array value is assigned, it will be treated as the list of commands which are displayed in the TreeList toolbar. Commands can be custom or built-in. The supported built-in commands are:create - Adds an empty data item to the treelist.excel - Exports the TreeList data in MS Excel format.pdf - Exports the TreeList data in PDF format.search - built-in search panel for the TreeList. or If an Object value is assigned, it will propagate these properties to the underlying Toolbar:items - an array of commands as explained aboveoverflow - an object that configures the overflow behavior of the toolbar. The same as Toolbar.overflow property.

C#
public TreeListBuilder<T> Toolbar(Action<TreeListToolbarSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListToolbarSettingsBuilder<T>>

The action that configures the toolbar.

Returns:

TreeListBuilder<T>

If a String value is assigned to the toolbar configuration option, it will be treated as a single string template for the whole TreeList toolbar and the string value will be passed as an argument to a kendo.template() function.; If a Function value is assigned (it may be a kendo.template() function call or a generic function reference), then the return value of the function will be used to render the contents of the TreeList toolbar. or If an Array value is assigned, it will be treated as the list of commands which are displayed in the TreeList toolbar. Commands can be custom or built-in. The supported built-in commands are:create - Adds an empty data item to the treelist.excel - Exports the TreeList data in MS Excel format.pdf - Exports the TreeList data in PDF format.search - built-in search panel for the TreeList..

C#
public TreeListBuilder<T> Toolbar(string template)
Parameters:templatestring

The template for the toolbar.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;ProductViewModel&gt;()
.Name("treelist")
.Toolbar("Template value")
)

Adds a custom component to the toolbar.

C#
public TreeListBuilder<T> Toolbar<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

The template component configuration for the custom component

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;ProductViewModel&gt;()
.Name("treelist")
.Toolbar(t =&gt;
{
t.Custom(Html.Kendo()
.Template()
.AddComponent(c =&gt; c.Button()
.Name("refresh"));
}))
)

If a String value is assigned to the toolbar configuration option, it will be treated as a single string template for the whole TreeList toolbar and the string value will be passed as an argument to a kendo.template() function.; If a Function value is assigned (it may be a kendo.template() function call or a generic function reference), then the return value of the function will be used to render the contents of the TreeList toolbar. or If an Array value is assigned, it will be treated as the list of commands which are displayed in the TreeList toolbar. Commands can be custom or built-in. The supported built-in commands are:create - Adds an empty data item to the treelist.excel - Exports the TreeList data in MS Excel format.pdf - Exports the TreeList data in PDF format.search - built-in search panel for the TreeList..

C#
public TreeListBuilder<T> ToolbarTemplateHandler(string handler)
Parameters:handlerstring

The view which contains the template.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;ProductViewModel&gt;()
.Name("treelist")
.ToolbarTemplateHandler("TemplateHandler")
)

Sets the id of the script element which contains the client-side toolbar template of the TreeList.

C#
public TreeListBuilder<T> ToolbarTemplateId(string template)
Parameters:templatestring

The template for the toolbar.

Returns:

TreeListBuilder<T>

Example:
C#
@(Html.Kendo().TreeList&lt;ProductViewModel&gt;()
.Name("treelist")
.ToolbarTemplateId("TemplateId")
)
In this article
DefinitionConstructorsTreeListBuilder(TreeList<T>)MethodsAltRowTemplate(string)AltRowTemplate<TModel>(TemplateBuilder<TModel>)AltRowTemplateHandler(string)AltRowTemplateId(string)AltRowTemplateView(MvcHtmlString)AutoBind(bool)BindTo(IEnumerable<T>)ColumnMenu()ColumnMenu(Action<TreeListColumnMenuSettingsBuilder<T>>)ColumnMenu(bool)Columns(Action<TreeListColumnFactory<T>>)DataSource(Action<TreeListAjaxDataSourceBuilder<T>>)DataSource(string)Editable()Editable(Action<TreeListEditableSettingsBuilder<T>>)Editable(bool)Events(Action<TreeListEventBuilder>)Excel(Action<TreeListExcelSettingsBuilder<T>>)Filterable()Filterable(Action<TreeListFilterableSettingsBuilder<T>>)Filterable(bool)Height(double)Messages(Action<TreeListMessagesSettingsBuilder<T>>)Navigatable()Navigatable(bool)Pageable()Pageable(Action<TreeListPageableSettingsBuilder>)Pageable(bool)Pdf(Action<TreeListPdfSettingsBuilder<T>>)Reorderable(bool)Resizable(bool)RowTemplate(string)RowTemplate<TModel>(TemplateBuilder<TModel>)RowTemplateHandler(string)RowTemplateId(string)RowTemplateView(MvcHtmlString)Scrollable(bool)Search(Action<TreeListSearchSettingsBuilder<T>>)Selectable()Selectable(Action<TreeListSelectableSettingsBuilder<T>>)Selectable(bool)Sortable()Sortable(Action<TreeListSortableSettingsBuilder<T>>)Sortable(bool)Toolbar(Action<TreeListToolbarFactory<T>>)Toolbar(Action<TreeListToolbarSettingsBuilder<T>>)Toolbar(string)Toolbar<TModel>(TemplateBuilder<TModel>)ToolbarTemplateHandler(string)ToolbarTemplateId(string)
Not finding the help you need?
Contact Support