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:
public abstract class GridColumnBuilderBase<TColumn, TColumnBuilder> where TColumn : IGridColumn where TColumnBuilder : GridColumnBuilderBase<TColumn, TColumnBuilder>
Inheritance: objectGridColumnBuilderBase<TColumn, TColumnBuilder>
Derived Classes:
Inherited Members
Constructors
Initializes a new instance of the GridColumnBuilderBase<TColumn, TColumnBuilder> class.
protected GridColumnBuilderBase(TColumn column)
The column.
Properties
Column
TColumn
Gets or sets the column.
public TColumn Column { get; }
The column.
Methods
If set to false the column menu will not be rendered for the specific column.
public virtual TColumnBuilder ColumnMenu(bool value)
If true the column menu will be rendered, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column draggable or not. By default the columns are not draggable.
public virtual TColumnBuilder Draggable(bool value)
If true the column is draggable, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
The configurator is used to configure the exportable setting of the column.
public virtual TColumnBuilder Exportable(Action<GridColumnExportableBuilder> configurator)
The configurator.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
If set to false the column will be excluded from the exported Excel/PDF files.
public virtual TColumnBuilder Exportable(bool value)
If true the column is exportable, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the HTML attributes applied to the header cell of the column.
public virtual TColumnBuilder HeaderHtmlAttributes(IDictionary<string, object> attributes, bool encodeAttributes = true)
The attributes.
encodeAttributesboolIndicates whether the attributes will be encoded. By default the HtmlAttibutes are encoded.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the HTML attributes applied to the header cell of the column.
public virtual TColumnBuilder HeaderHtmlAttributes(object attributes, bool encodeAttributes = true)
The attributes.
encodeAttributesboolIndicates whether the attributes will be encoded. By default the HtmlAttibutes are encoded.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Hides a column. By default all columns are not hidden. Hidden columns are rendered in the output HTML but are hidden.
public virtual TColumnBuilder Hidden()
TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column hidden or not. By default all columns are not hidden. Hidden columns are rendered in the output HTML but are hidden.
public virtual TColumnBuilder Hidden(bool value)
If true the column is hidden, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the HTML attributes applied to the content cell of the column.
public virtual TColumnBuilder HtmlAttributes(IDictionary<string, object> attributes, bool encodeAttributes = true)
The attributes.
encodeAttributesboolIndicates whether the attributes will be encoded. By default the HtmlAttibutes are encoded.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the HTML attributes applied to the content cell of the column.
public virtual TColumnBuilder HtmlAttributes(object attributes, bool encodeAttributes = true)
The attributes.
encodeAttributesboolIndicates whether the attributes will be encoded. By default the HtmlAttibutes are encoded.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets name of the handler that sets the html attributes
public virtual TColumnBuilder HtmlAttributes(string attributesHandler)
The attributes handler name.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
If set to false the column will remain in the side of the grid into which its own locked configuration placed it.
public virtual TColumnBuilder Lockable(bool value)
If true the column is lockable, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column static. By default all columns are not locked.
public virtual TColumnBuilder Locked()
TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column static or not. By default all columns are not locked.
public virtual TColumnBuilder Locked(bool value)
If true the column is locked, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the media query condition that needs to be satisfied for a column to remain visible.
public virtual TColumnBuilder Media(string value)
The text.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
MergeAttributes method.
protected static void MergeAttributes(IDictionary<string, object> target, IDictionary<string, object> attributes)
The pixel screen width below which the user will not be able to resize the column via the UI.
public virtual TColumnBuilder MinResizableWidth(int value)
TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the minimum screen width in pixels at which the column will become hidden.
public virtual TColumnBuilder MinScreenWidth(int value)
TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
If set to false the column will become non-resizable, while all the other columns remaining resizable in the grid component. In order for this property to work, grid's resizable functionality must be be enabled.
public virtual TColumnBuilder Resizable(bool value)
If false the column is not resizable.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column stickable. By default all columns are not stickable.
public virtual TColumnBuilder Stickable()
TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column stickable or not. By default all columns are not stickable.
public virtual TColumnBuilder Stickable(bool value)
If true the column is stickable, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column sticky. By default all columns are not sticky.
public virtual TColumnBuilder Sticky()
TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column sticky or not. By default all columns are not sticky.
public virtual TColumnBuilder Sticky(bool value)
If true the column is sticky, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the title displayed in the header of the column. Any HTML entities or tags should be encoded, or use a HeaderTemplate instead.
public virtual TColumnBuilder Title(string text)
The text.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Makes the column visible or not. By default all columns are visible. Invisible columns are not rendered in the output HTML.
public virtual TColumnBuilder Visible(bool value)
If true the column is visible, otherwise not.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the width of the column in pixels.
public virtual TColumnBuilder Width(int pixelWidth)
The width in pixels.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.
Sets the width of the column using CSS syntax.
public virtual TColumnBuilder Width(string value)
The width to set.
Returns:TColumnBuilder
Returns the current TColumnBuilder instance for method chaining.