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

Defines the fluent interface for configuring columns.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TColumn

TColumnBuilder

The type of the column builder.

Syntax:

C#
public abstract class GanttColumnBuilderBase<TColumn, TColumnBuilder> where TColumn : IGanttColumn where TColumnBuilder : GanttColumnBuilderBase<TColumn, TColumnBuilder>

Inheritance: objectGanttColumnBuilderBase<TColumn, TColumnBuilder>

Derived Classes: GanttBoundColumnBuilder<TTaskModel, TDependenciesModel>GanttDraggableColumnBuilder<TTaskModel>GanttGroupColumnBuilder<TTaskModel, TDependenciesModel>GanttResourceColumnBuilder<TTaskModel>

Inherited Members object.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 GanttColumnBuilderBase<TColumn, TColumnBuilder> class.

C#
protected GanttColumnBuilderBase(TColumn column)
Parameters:columnTColumn

The column.

Properties

Column

TColumn

Gets or sets the column.

C#
public TColumn Column { get; }
Property Value:

The column.

Methods

Makes the column editable or not.By default a column is not editable.

C#
public TColumnBuilder Editable(bool value)
Parameters:valueboolReturns:

TColumnBuilder

Example:
C#
@( Html.Kendo().Gantt(Model)
.Name("Gantt")
.Columns(columns =&gt; columns.Bound(o =&gt; o.OrderID).Editable(true))
)

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

C#
public TColumnBuilder Expandable(bool value)
Parameters:valuebool

The value that configures the expandable.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).Expandable(true);
})
)

If set to true and if filtering is enabled for the entire Gantt, 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 TColumnBuilder Filterable(Action<GanttColumnFilterableSettingsBuilder> configurator)
Parameters:configuratorAction<GanttColumnFilterableSettingsBuilder>

The action that configures the filterable.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).Filterable(f =&gt; f.Ui("compareHandler"));
})
)

If set to true and if filtering is enabled for the entire Gantt, 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 TColumnBuilder Filterable(bool enabled)
Parameters:enabledbool

Enables or disables the filterable option.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).Filterable(true);
})
)

Gets or sets the format for displaying the data.

C#
public TColumnBuilder Format(string value)
Parameters:valuestring

The value.

Returns:

TColumnBuilder

Example:
C#
@( Html.Kendo().Gantt(Model)
.Name("Gantt")
.Columns(columns =&gt; columns.Bound(o =&gt; o.OrderDate).Format("{0:dd/MM/yyyy}"))
)

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

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

The value that configures the headerattributes.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HeaderAttributes(attr);
})
)

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

C#
public TColumnBuilder HeaderAttributes(object value)
Parameters:valueobject

The value that configures the headerattributes.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HeaderAttributes(new { data-custom = "Value" });
})
)

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 TColumnBuilder HeaderTemplate(string value)
Parameters:valuestring

The value that configures the headertemplate.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HeaderTemplate("Value");
})
)

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 TColumnBuilder HeaderTemplate(TemplateBuilder<dynamic> template)
Parameters:templateTemplateBuilder<dynamic>

The content of the column.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title)
.HeaderTemplate(Html.Kendo().Template()
.AddHtml("&lt;div class='my-custom-cell'&gt;${data.Title}&lt;/div&gt;")
);
})
)

The template which renders the custom content of the Header.

C#
public TColumnBuilder HeaderTemplateHandler(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HeaderTemplateHandler("templateHandler");
})
)

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 TColumnBuilder HeaderTemplateId(string value)
Parameters:valuestring

The value that configures the headertemplate.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HeaderTemplateId("Value");
})
)

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 TColumnBuilder HeaderTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the headertemplate.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HeaderTemplateView(Html.Partial("TemplateView"))
})
)

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

C#
public TColumnBuilder Hidden(bool value)
Parameters:valuebool

The value that configures the hidden.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).Hidden(true);
})
)

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

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

The value that configures the htmlattributes.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HtmlAttributes(attr);
})
)

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

C#
public TColumnBuilder HtmlAttributes(object value)
Parameters:valueobject

The value that configures the htmlattributes.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).HtmlAttributes(new { data-custom = "Value" });
})
)

If set to true, the Gantt 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 TColumnBuilder Menu(bool value)
Parameters:valuebool

The value that configures the menu.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).Menu(true);
})
)

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 TColumnBuilder MinScreenWidth(double value)
Parameters:valuedouble

The value that configures the minscreenwidth.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).MinScreenWidth(1600);
})
)

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

C#
public TColumnBuilder Template(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).Template("Value");
})
)

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

C#
public TColumnBuilder Template(TemplateBuilder<dynamic> template)
Parameters:templateTemplateBuilder<dynamic>

The value for the Template

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title)
.Template(Html.Kendo().Template()
.AddHtml("&lt;div class='my-custom-cell'&gt;${data.Title}&lt;/div&gt;")
);
})
)

The template which renders the custom content.

C#
public TColumnBuilder TemplateHandler(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).TemplateHandler("templateHandler");
})
)

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

C#
public TColumnBuilder TemplateId(string value)
Parameters:valuestring

The value that configures the template.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).TemplateId("Value");
})
)

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

C#
public TColumnBuilder TemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the template.

Returns:

TColumnBuilder

Example:
C#
@(Html.Kendo().Gantt&lt;TaskViewModel, DependencyViewModel&gt;()
.Name("gantt")
.Columns(columns =&gt;
{
columns.Bound(c =&gt; c.Title).TemplateView(Html.Partial("TemplateView"));
})
)

Sets the title displayed in the header of the column.

C#
public TColumnBuilder Title(string text)
Parameters:textstring

The text.

Returns:

TColumnBuilder

Example:
C#
@( Html.Kendo().Gantt(Model)
.Name("Gantt")
.Columns(columns =&gt; columns.Bound(o =&gt; o.OrderID).Title("ID"))
)

Sets the width of the column in pixels.

C#
public TColumnBuilder Width(int pixelWidth)
Parameters:pixelWidthint

The width in pixels.

Returns:

TColumnBuilder

Example:
C#
@( Html.Kendo().Gantt(Model)
.Name("Gantt")
.Columns(columns =&gt; columns.Bound(o =&gt; o.OrderID).Width(100))
)