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

Defines the fluent API for configuring the TreeListColumn settings.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class TreeListColumnBuilder<T> where T : class

Inheritance: objectTreeListColumnBuilder<T>

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public TreeListColumnBuilder(TreeListColumn settings, ViewContext viewContext, IUrlGenerator urlGenerator)
Parameters:settingsTreeListColumnviewContextViewContexturlGeneratorIUrlGenerator

Methods

The configuration of the column commands. If set, the column will display a button for every command. Commands can be custom or built-inThe built-in commands are: edit - Switches the current table row to edit mode. Supports the inline and popup edit modes.; createChild- Adds a new child item to the current table row and switches to edit mode. or destroy - Removes the data item to which the current table row is bound.. Custom commands are supported by specifying the click option.

C#
public TreeListColumnBuilder<T> Command(Action<TreeListColumnCommandFactory<T>> configurator)
Parameters:configuratorAction<TreeListColumnCommandFactory<T>>

The action that configures the command.

Returns:

TreeListColumnBuilder<T>

Defines a Draggable column.

C#
public TreeListColumnBuilder<T> Draggable()
Returns:

TreeListColumnBuilder<T>

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

The JavaScript function that is executed when the cell or row is about to be opened for editing. The returned result will determine whether an editor for the column will be created.

C#
public TreeListColumnBuilder<T> Editable(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The value that configures the editable action.

Returns:

TreeListColumnBuilder<T>

The JavaScript function that is executed when the cell or row is about to be opened for editing. The returned result will determine whether an editor for the column will be created.

C#
public TreeListColumnBuilder<T> Editable(string handler)
Parameters:handlerstring

The value that configures the editable action.

Returns:

TreeListColumnBuilder<T>

Provides a way to specify a custom editing UI for the column. Use the container parameter to create the editing UI.

C#
public TreeListColumnBuilder<T> Editor(string value)
Parameters:valuestring

The value that configures the editor.

Returns:

TreeListColumnBuilder<T>

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

Specify which editor template should be used for the column.

C#
public TreeListColumnBuilder<T> EditorTemplateComponentName(string templateName)
Parameters:templateNamestringReturns:

TreeListColumnBuilder<T>

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

If set to true, the column value will be HTML-encoded before it is displayed. If set to false, the column value will be displayed as is. By default, the column value is HTML-encoded.

C#
public TreeListColumnBuilder<T> Encoded(bool value)
Parameters:valuebool

The value that configures the encoded.

Returns:

TreeListColumnBuilder<T>

If set to true, the column will show the icons that are used for expanding and collapsing child rows. By default, the first column of the TreeList is expandable.

C#
public TreeListColumnBuilder<T> Expandable(bool value)
Parameters:valuebool

The value that configures the expandable.

Returns:

TreeListColumnBuilder<T>

The field to which the column is bound. The value of this field is displayed by the column during data binding.

C#
public TreeListColumnBuilder<T> Field(string value)
Parameters:valuestring

The value that configures the field.

Returns:

TreeListColumnBuilder<T>

The field to which the column is bound. The value of this field is displayed by the column during data binding.

C#
public TreeListColumnBuilder<T> Field<TValue>(Expression<Func<T, TValue>> expression)
Parameters:expressionExpression<Func<T, TValue>>

The expression that specifies the field, based on the bound model.

Returns:

TreeListColumnBuilder<T>

If set to true a filter menu will be displayed for this column when filtering is enabled. If set to false the filter menu will not be displayed. By default a filter menu is displayed for all columns when filtering is enabled via the filterable option. Can be set to a JavaScript object which represents the filter menu configuration.

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

TreeListColumnBuilder<T>

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

If set to true and if filtering is enabled, a filter menu will be displayed for this column. If set to false, the filter menu will not be displayed. By default, a filter menu is displayed for all columns when filtering is enabled through the filterable option. Can be set to a JavaScript object which represents the filter menu configuration.

C#
public TreeListColumnBuilder<T> Filterable(Action<TreeListColumnFilterableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListColumnFilterableSettingsBuilder<T>>

The configurator for the filterable setting.

Returns:

TreeListColumnBuilder<T>

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

If set to true and if filtering is enabled, a filter menu will be displayed for this column. If set to false, the filter menu will not be displayed. By default, a filter menu is displayed for all columns when filtering is enabled through the filterable option. Can be set to a JavaScript object which represents the filter menu configuration.

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

Enables or disables the filterable option.

Returns:

TreeListColumnBuilder<T>

The template which renders the footer table cell for the column.The following fields can be used in the template: average - The value of the average aggregate (if specified).; count - The value of the count aggregate (if specified).; max - The value of the max aggregate (if specified).; min - The value of the min aggregate (if specified). or sum - The value of the sum aggregate (if specified)..

C#
public TreeListColumnBuilder<T> FooterTemplate(string value)
Parameters:valuestring

The value that configures the footertemplate.

Returns:

TreeListColumnBuilder<T>

The template which renders the footer table cell for the column.The following fields can be used in the template: average - The value of the average aggregate (if specified).; count - The value of the count aggregate (if specified).; max - The value of the max aggregate (if specified).; min - The value of the min aggregate (if specified). or sum - The value of the sum aggregate (if specified)..

C#
public TreeListColumnBuilder<T> FooterTemplateHandler(string value)
Parameters:valuestring

The value that configures the footer template.

Returns:

TreeListColumnBuilder<T>

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

The template which renders the footer table cell for the column.The following fields can be used in the template: average - The value of the average aggregate (if specified).; count - The value of the count aggregate (if specified).; max - The value of the max aggregate (if specified).; min - The value of the min aggregate (if specified). or sum - The value of the sum aggregate (if specified)..

C#
public TreeListColumnBuilder<T> FooterTemplateId(string value)
Parameters:valuestring

The value that configures the footertemplate.

Returns:

TreeListColumnBuilder<T>

The template which renders the footer table cell for the column.The following fields can be used in the template: average - The value of the average aggregate (if specified).; count - The value of the count aggregate (if specified).; max - The value of the max aggregate (if specified).; min - The value of the min aggregate (if specified). or sum - The value of the sum aggregate (if specified)..

C#
public TreeListColumnBuilder<T> FooterTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the footer template view.

Returns:

TreeListColumnBuilder<T>

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

The format that is applied to the value before it is displayed. Takes the {0:format} form where format is a standard number format, custom number format, standard date format or a custom date format.

C#
public TreeListColumnBuilder<T> Format(string value)
Parameters:valuestring

The value that configures the format.

Returns:

TreeListColumnBuilder<T>

The HTML attributes of the table header cell (<th>) that is rendered for the column.

C#
public TreeListColumnBuilder<T> HeaderAttributes(IDictionary<string, object> value)
Parameters:valueIDictionary<string, object>

The value that configures the headerattributes.

Returns:

TreeListColumnBuilder<T>

The HTML attributes of the table header cell (<th>) that is rendered for the column.

C#
public TreeListColumnBuilder<T> HeaderAttributes(object value)
Parameters:valueobject

The value that configures the headerattributes.

Returns:

TreeListColumnBuilder<T>

The template which renders the column header content. By default, the value of the title column option is displayed in the column header cell.

C#
public TreeListColumnBuilder<T> HeaderTemplate(string value)
Parameters:valuestring

The value that configures the headertemplate.

Returns:

TreeListColumnBuilder<T>

The template which renders the footer table cell for the column.The following fields can be used in the template: average - The value of the average aggregate (if specified).; count - The value of the count aggregate (if specified).; max - The value of the max aggregate (if specified).; min - The value of the min aggregate (if specified). or sum - The value of the sum aggregate (if specified)..

C#
public TreeListColumnBuilder<T> HeaderTemplateHandler(string value)
Parameters:valuestring

The value that configures the header template.

Returns:

TreeListColumnBuilder<T>

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

The template which renders the column header content. By default, the value of the title column option is displayed in the column header cell.

C#
public TreeListColumnBuilder<T> HeaderTemplateId(string value)
Parameters:valuestring

The value that configures the headertemplate.

Returns:

TreeListColumnBuilder<T>

The template which renders the column header content. By default, the value of the title column option is displayed in the column header cell.

C#
public TreeListColumnBuilder<T> HeaderTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the header template view.

Returns:

TreeListColumnBuilder<T>

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

If set to true, the TreeList will not display the column. By default, all columns are displayed.

C#
public TreeListColumnBuilder<T> Hidden(bool value)
Parameters:valuebool

The value that configures the hidden.

Returns:

TreeListColumnBuilder<T>

The HTML attributes of the table cell (<td>) that is rendered for the column.

C#
public TreeListColumnBuilder<T> HtmlAttributes(IDictionary<string, object> value)
Parameters:valueIDictionary<string, object>

The value that configures the htmlattributes.

Returns:

TreeListColumnBuilder<T>

The HTML attributes of the table cell (<td>) that is rendered for the column.

C#
public TreeListColumnBuilder<T> HtmlAttributes(object value)
Parameters:valueobject

The value that configures the htmlattributes.

Returns:

TreeListColumnBuilder<T>

If set to true, the TreeList will select all child rows upon parent row selection when checkbox selection is used.

C#
public TreeListColumnBuilder<T> IncludeChildren(bool value)
Parameters:valuebool

The value that configures the includechildren.

Returns:

TreeListColumnBuilder<T>

If set to false, the column will remain in that side of the TreeList where its own locked configuration placed it.

C#
public TreeListColumnBuilder<T> Lockable(bool value)
Parameters:valuebool

The value that configures the lockable.

Returns:

TreeListColumnBuilder<T>

If set to true, the TreeList will display the column as locked (frozen).

C#
public TreeListColumnBuilder<T> Locked(bool value)
Parameters:valuebool

The value that configures the locked.

Returns:

TreeListColumnBuilder<T>

If set to true, the TreeList will display the column in the column menu. By default, the column menu includes all data-bound columns, that is, the ones with a set field option.

C#
public TreeListColumnBuilder<T> Menu(bool value)
Parameters:valuebool

The value that configures the menu.

Returns:

TreeListColumnBuilder<T>

The pixel screen width below which the column will be hidden. The setting takes precedence over the hidden setting and the two cannot not be used at the same time.

C#
public TreeListColumnBuilder<T> MinScreenWidth(double value)
Parameters:valuedouble

The value that configures the minscreenwidth.

Returns:

TreeListColumnBuilder<T>

If set to true the treelist will render a select column with checkboxes in each cell, thus enabling multi-row selection. The header checkbox allows users to select/deselect all the rows on the current page.

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

The value that configures the selectable.

Returns:

TreeListColumnBuilder<T>

If set to true the user can click the column header and sort the grid by the column field when sorting is enabled. If set to false sorting will be disabled for this column. By default all columns are sortable if sorting is enabled via the sortable option.

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

TreeListColumnBuilder<T>

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

If set to true and sorting is enabled, the user can click the column header and sort the TreeList by the column field. If set to false, sorting will be disabled for this column. By default, all columns are sortable if sorting is enabled though the sortable option.

C#
public TreeListColumnBuilder<T> Sortable(Action<TreeListColumnSortableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TreeListColumnSortableSettingsBuilder<T>>

The action that configures the sortable.

Returns:

TreeListColumnBuilder<T>

If set to true and sorting is enabled, the user can click the column header and sort the TreeList by the column field. If set to false, sorting will be disabled for this column. By default, all columns are sortable if sorting is enabled though the sortable option.

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

Enables or disables the sortable option.

Returns:

TreeListColumnBuilder<T>

The template which renders the column content. The TreeList renders table rows (<tr>) which represent the data source items. Each table row consists of table cells (<td>) which represent the TreeList columns. By default, the HTML-encoded value of the field is displayed in the column.

C#
public TreeListColumnBuilder<T> Template(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TreeListColumnBuilder<T>

The template which renders the column content. The TreeList renders table rows (<tr>) which represent the data source items. Each table row consists of table cells (<td>) which represent the TreeList columns. By default, the HTML-encoded value of the field is displayed in the column.

C#
public TreeListColumnBuilder<T> Template<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>Returns:

TreeListColumnBuilder<T>

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

The template which renders the column content. The TreeList renders table rows (<tr>) which represent the data source items. Each table row consists of table cells (<td>) which represent the TreeList columns. By default, the HTML-encoded value of the field is displayed in the column.

C#
public TreeListColumnBuilder<T> TemplateHandler(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TreeListColumnBuilder<T>

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

The template which renders the column content. The TreeList renders table rows (<tr>) which represent the data source items. Each table row consists of table cells (<td>) which represent the TreeList columns. By default, the HTML-encoded value of the field is displayed in the column.

C#
public TreeListColumnBuilder<T> TemplateId(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TreeListColumnBuilder<T>

The template which renders the column content. The TreeList renders table rows (<tr>) which represent the data source items. Each table row consists of table cells (<td>) which represent the TreeList columns. By default, the HTML-encoded value of the field is displayed in the column.

C#
public TreeListColumnBuilder<T> TemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the template view.

Returns:

TreeListColumnBuilder<T>

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

The text that is displayed in the column header cell. If not set, the TreeList uses field.

C#
public TreeListColumnBuilder<T> Title(string value)
Parameters:valuestring

The value that configures the title.

Returns:

TreeListColumnBuilder<T>

The width of the column. Numeric values are treated as pixels. For more important information, please refer to Column Widths.

C#
public TreeListColumnBuilder<T> Width(int value)
Parameters:valueint

The value that configures the width.

Returns:

TreeListColumnBuilder<T>

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

The width of the column. Numeric values are treated as pixels.

C#
public TreeListColumnBuilder<T> Width(string value)
Parameters:valuestring

The value that configures the width.

Returns:

TreeListColumnBuilder<T>