GridBuilder<T>
The fluent API for configuring Kendo UI Grid for ASP.NET MVC.
Definition
Namespace:Kendo.Mvc.UI.Fluent
Assembly:Kendo.Mvc.dll
Type Parameters:
T
Syntax:
public class GridBuilder<T> : WidgetBuilderBase<Grid<T>, GridBuilder<T>>, IHtmlString where T : class
Inheritance: objectWidgetBuilderBase<Grid<T>, GridBuilder<T>>GridBuilder<T>
Implements:
Inherited Members
Constructors
Initializes a new instance of the GridBuilder<T> class.
Methods
Specifies the adaptive rendering of the component.
public GridBuilder<T> AdaptiveMode(AdaptiveMode value)
The value for AdaptiveMode
Returns:GridBuilder<T>
Defines the configuration options for the AI tools in the Grid.
public GridBuilder<T> AI(Action<GridAiSettingsBuilder<T>> configurator)
The GridAiSettingsBuilder<T> for the ai setting.
Returns:GridBuilder<T>
Returns the current instance of GridBuilder<T> .
Configures the allow copy settings of the grid.
public GridBuilder<T> AllowCopy(Action<GridAllowCopyBuilder> configurator)
The lambda which configures the allow copy settings.
Returns:GridBuilder<T>
If set to true users can copy the selection to the clipboard and paste it to Excel or similar spreadsheet applications.
Setting AllowCopy to true requires Selectable to be enabled.
public GridBuilder<T> AllowCopy(bool value)
If true the grid will be automatically data bound, otherwise false
Returns:GridBuilder<T>
If set to true and selection of the Grid is enabled, the user can paste the current text contents of the clipboard into the Grid.
If set to true and selection of the Grid is enabled, the user can paste the current text contents of the clipboard into the Grid.
public GridBuilder<T> AllowPaste(bool value)
The value for AllowPaste
Returns:GridBuilder<T>
If set to false the widget will not bind to the data source during initialization; the default value is true.
Setting AutoBind to false is supported in ajax-bound mode.
public GridBuilder<T> AutoBind(bool value)
If true the grid will be automatically data bound, otherwise false
Returns:GridBuilder<T>
Binds the grid to a list of objects
public GridBuilder<T> BindTo(IEnumerable dataSource)
The data source.
Returns:GridBuilder<T>
Binds the grid to a list of objects
public GridBuilder<T> BindTo(IEnumerable<T> dataSource)
The data source.
Returns:GridBuilder<T>
Sets a lambda which is executed for every table cell rendered server-side by the grid.
public GridBuilder<T> CellAction(Action<GridCell<T>> configurator)
The lambda which will be executed for every table cell
Returns:GridBuilder<T>
Sets the client-side alt row template of the grid. The client-side alt row template must contain a table row element (tr).
public GridBuilder<T> ClientAltRowTemplate(Func<Grid<T>, string> template)
The template
Returns:GridBuilder<T>
Sets the client-side alt row template of the grid. The client-side alt row template must contain a table row element (tr).
public GridBuilder<T> ClientAltRowTemplate(string template)
The template
Returns:GridBuilder<T>
Sets the client alt row template for the grid using a template builder.
public GridBuilder<T> ClientAltRowTemplate<TModel>(TemplateBuilder<TModel> template)
The template builder that defines the client alt row template.
Returns:GridBuilder<T>
Sets the name of the JavaScript function that will be used as the client alt row template handler for the grid.
public GridBuilder<T> ClientAltRowTemplateHandler(string template)
The name of the JavaScript function that will handle the client alt row template.
Returns:GridBuilder<T>
public GridBuilder<T> ClientDetailTemplate<TModel>(TemplateBuilder<TModel> template)
GridBuilder<T>
public GridBuilder<T> ClientDetailTemplateHandler(string value)
GridBuilder<T>
Sets the id of the script element which contains the client-side detail template of the grid.
public GridBuilder<T> ClientDetailTemplateId(string id)
The id
Returns:GridBuilder<T>
Sets the id of the script element which contains the client-side detail template of the grid.
public GridBuilder<T> ClientDetailTemplateView(MvcHtmlString template)
GridBuilder<T>
Sets the client-side row template of the grid. The client-side row template must contain a table row element (tr).
public GridBuilder<T> ClientRowTemplate(Func<Grid<T>, string> template)
The template
Returns:GridBuilder<T>
Sets the client-side row template of the grid. The client-side row template must contain a table row element (tr).
public GridBuilder<T> ClientRowTemplate(string template)
The template
Returns:GridBuilder<T>
Sets the client row template for the grid using a template builder.
public GridBuilder<T> ClientRowTemplate<TModel>(TemplateBuilder<TModel> template)
The template builder that defines the client row template.
Returns:GridBuilder<T>
Sets the name of the JavaScript function that will be used as the client row template handler for the grid.
public GridBuilder<T> ClientRowTemplateHandler(string template)
The name of the JavaScript function that will handle the client row template.
Returns:GridBuilder<T>
Enables the grid column menu.
Sets the column menu configuration of the grid.
public GridBuilder<T> ColumnMenu(Action<GridColumnMenuSettingsBuilder> configurator)
The lambda which configures the column menu
Returns:GridBuilder<T>
Sets the width of the column resize handle. Apply a larger value for easier grasping.
public GridBuilder<T> ColumnResizeHandleWidth(int width)
width in pixels
Returns:GridBuilder<T>
Sets the column configuration of the grid.
public GridBuilder<T> Columns(Action<GridColumnFactory<T>> configurator)
The lambda which configures columns
Returns:GridBuilder<T>
Enables the Grid's Context Menu.
Sets the ContextMenu configuration of the grid.
public GridBuilder<T> ContextMenu(Action<GridContextMenuBuilder> configurator)
The lambda which configures the Context Menu
Returns:GridBuilder<T>
Defines the data layout mode of the grid.
public GridBuilder<T> DataLayoutMode(DataLayoutMode value)
The value for DataLayoutMode
Returns:GridBuilder<T>
Returns the current GridBuilder<T> instance.
Sets the data source configuration of the grid.
public GridBuilder<T> DataSource(Action<DataSourceBuilder<T>> configurator)
The lambda which configures the data source
Returns:GridBuilder<T>
Sets the ID of the DataSource widget used by the Grid.
public GridBuilder<T> DataSource(string dataSourceId)
The id of the DataSource
Returns:GridBuilder<T>
Sets the server-side detail template of the grid in ASPX views.
public GridBuilder<T> DetailTemplate(Action<T> codeBlockTemplate)
The template as a code block
Returns:GridBuilder<T>
Sets the server-side detail template of the grid in Razor views.
public GridBuilder<T> DetailTemplate(Func<T, object> inlineTemplate)
The template
Returns:GridBuilder<T>
Enables grid editing.
Sets the editing configuration of the grid.
public GridBuilder<T> Editable(Action<GridEditingSettingsBuilder<T>> configurator)
The lambda which configures the editing
Returns:GridBuilder<T>
Sets the edit mode of the grid.
public GridBuilder<T> Editable(GridEditMode configurator)
The lambda which configures the editing
Returns:GridBuilder<T>
If set to true the grid will perform custom binding.
public GridBuilder<T> EnableCustomBinding(bool value)
If true enables custom binding.
Returns:GridBuilder<T>
If set to true the column title will be HTML-encoded before it is displayed. If set to false the column title will be displayed as is.
If set to true the column title will be HTML-encoded before it is displayed. If set to false the column title will be displayed as is.
public GridBuilder<T> EncodeTitles(bool value)
The value for EncodeTitles
Returns:GridBuilder<T>
Sets the event configuration of the grid.
public GridBuilder<T> Events(Action<GridEventBuilder> configurator)
The lambda which configures the events
Returns:GridBuilder<T>
Configures the Excel export settings.
public GridBuilder<T> Excel(Action<GridExcelBuilder> configurator)
GridBuilder<T>
Enables grid filtering.
Sets the filtering configuration of the grid.
public GridBuilder<T> Filterable(Action<GridFilterableSettingsBuilder> configurator)
The lambda which configures the filtering
Returns:GridBuilder<T>
Enables grid grouping.
Sets the grouping configuration of the grid.
public GridBuilder<T> Groupable(Action<GridGroupingSettingsBuilder> configurator)
The lambda which configures the grouping
Returns:GridBuilder<T>
Sets the height of the grid.
public GridBuilder<T> Height(int pixelHeight)
The height of the grid. Numeric values are treated as pixels.
Returns:GridBuilder<T>
Sets the height of the grid.
public GridBuilder<T> Height(string value)
The height of the grid.
Returns:GridBuilder<T>
Defines the type of the loader that will be displayed while loading the data
public GridBuilder<T> LoaderType(GridLoaderType value)
The value for LoaderType
Returns:GridBuilder<T>
Configures the grid messages.
public GridBuilder<T> Messages(Action<GridMessagesBuilder> configurator)
Defines the text of the messages used by the Grid
Returns:GridBuilder<T>
Enables the adaptive rendering when viewed on mobile browser
Used to determine if adaptive rendering should be used when viewed on mobile browser
public GridBuilder<T> Mobile(MobileMode type)
Defines the type of the Mobile Mode
Returns:GridBuilder<T>
Currently the Grid widget doesn't distinguish between phone and tablet option.
Enables grid keyboard navigation.
Sets the keyboard navigation configuration of the grid.
public GridBuilder<T> Navigatable(Action<GridNavigatableSettingsBuilder> configurator)
The lambda which configures the keyboard navigation
Returns:GridBuilder<T>
Enables grid noRecords.
Sets the noRecords configuration of the grid.
public GridBuilder<T> NoRecords(Action<GridNoRecordsSettingsBuilder> configurator)
The lambda which configures the noRecords
Returns:GridBuilder<T>
If set to true and current view contains no records, message similar to "No records available" will be displayed. By default this option is disabled.
public GridBuilder<T> NoRecords(bool enabled)
Enables or disables the norecords option.
Returns:GridBuilder<T>
Returns the current instance of GridNoRecordsSettingsBuilder<T> .
Enables grid noRecords and sets it's message.
public GridBuilder<T> NoRecords(string text)
The message used for noRecords
Returns:GridBuilder<T>
Enables grid paging.
Sets the paging configuration of the grid.
public GridBuilder<T> Pageable(Action<GridPageableSettingsBuilder> configurator)
The lambda which configures the paging
Returns:GridBuilder<T>
Configures the PDF export settings.
public GridBuilder<T> Pdf(Action<PDFSettingsBuilder> configurator)
GridBuilder<T>
Sets a value indicating whether the selection will be persisted when sorting, paging, filtering and etc are performed.
Sets a value indicating whether the selection will be persisted when sorting, paging, filtering and etc are performed.
public GridBuilder<T> PersistSelection(bool value)
The value for PersistSelection
Returns:GridBuilder<T>
Enables row pinning for the Grid. When enabled, users can pin rows to the top or bottom of the Grid.
Enables row pinning for the Grid and allows further configuration of pinnable settings.
public GridBuilder<T> Pinnable(Action<GridPinnableSettingsBuilder<T>> configurator)
The action that configures the pinnable settings.
Returns:GridBuilder<T>
Enables or disables row pinning for the Grid.
public GridBuilder<T> Pinnable(bool enabled)
If true, row pinning is enabled; otherwise, false.
GridBuilder<T>
Sets the template used for rendering pinned rows in the Grid using a template builder.
public GridBuilder<T> PinnedRowTemplate<TModel>(TemplateBuilder<TModel> template)
The template builder that defines the pinned row template.
Returns:GridBuilder<T>
Sets the template used for rendering pinned rows in the Grid. Accepts a Kendo UI template string.
public GridBuilder<T> PinnedRowTemplateHandler(string template)
The Kendo UI template string for pinned rows.
Returns:GridBuilder<T>
If set to true the grid will prefix the query string parameters with its name during server binding.
By default the grid will prefix the query string parameters.
public GridBuilder<T> PrefixUrlParameters(bool prefix)
GridBuilder<T>
Sets the reordering configuration of the grid.
public GridBuilder<T> Reorderable(Action<GridReorderingSettingsBuilder> configurator)
The lambda which configures the reordering
Returns:GridBuilder<T>
Sets the resizing configuration of the grid.
public GridBuilder<T> Resizable(Action<GridResizingSettingsBuilder> configurator)
The lambda which configures the resizing
Returns:GridBuilder<T>
Sets a lambda which is executed for every table row rendered server-side by the grid.
public GridBuilder<T> RowAction(Action<GridRow<T>> configurator)
The lambda which will be executed for every table row
Returns:GridBuilder<T>
Sets the server-side row template of the grid in ASPX views.
public GridBuilder<T> RowTemplate(Action<T, Grid<T>> codeBlockTemplate)
The template as a code block
Returns:GridBuilder<T>
Sets the server-side row template of the grid in ASPX views.
public GridBuilder<T> RowTemplate(Action<T> codeBlockTemplate)
The template as a code block
Returns:GridBuilder<T>
Sets the server-side row template of the grid in Razor views.
public GridBuilder<T> RowTemplate(Func<Grid<T>, Func<T, object>> inlineTemplate)
The template
Returns:GridBuilder<T>
Sets the server-side row template of the grid in Razor views.
public GridBuilder<T> RowTemplate(Func<T, object> inlineTemplate)
The template
Returns:GridBuilder<T>
Enables grid scrolling.
Sets the scrolling configuration of the grid.
public GridBuilder<T> Scrollable(Action<GridScrollSettingsBuilder> configurator)
The lambda which configures the scrolling
Returns:GridBuilder<T>
Configures the Kendo UI Grid search bar settings.
public GridBuilder<T> Search(Action<GridSearchSettingsBuilder<T>> configurator)
The configurator for the search setting.
Returns:GridBuilder<T>
Enables grid row selection.
Sets the selection configuration of the grid.
public GridBuilder<T> Selectable(Action<GridSelectionSettingsBuilder> configurator)
The lambda which configures the selection
Returns:GridBuilder<T>
Sets the size of the grid.
public GridBuilder<T> Size(ComponentSize value)
The size of the grid.
Returns:GridBuilder<T>
Defines the configuration options for the SmartBox tool in the Grid. The SmartBox provides a unified interface for search, semantic search, and AI assistant capabilities.
public GridBuilder<T> SmartBox(Action<GridSmartBoxSettingsBuilder<T>> configurator)
The configurator for the SmartBox setting.
Returns:GridBuilder<T>
Enables grid column sorting.
Sets the sorting configuration of the grid.
public GridBuilder<T> Sortable(Action<GridSortSettingsBuilder<T>> configurator)
The lambda which configures the sorting
Returns:GridBuilder<T>
The stacked layout settings of the Grid.
public GridBuilder<T> StackedLayoutSettings(Action<GridStackedLayoutSettingsSettingsBuilder> configurator)
The GridStackedLayoutSettingsSettingsBuilder for the stackedlayoutsettings setting.
Returns:GridBuilder<T>
Returns the current instance of GridBuilder<T> .
Sets the status bar template for the grid.
[Obsolete("This method is obsolete. Use StatusBarTemplate or StatusBarTemplateHandler overloads instead.")]
public GridBuilder<T> StatusBarTemplate(string template)
The template string for the status bar.
Returns:GridBuilder<T>
Sets the status bar template for the grid using a template builder.
public GridBuilder<T> StatusBarTemplate<TModel>(TemplateBuilder<TModel> template)
The template builder that defines the status bar template.
Returns:GridBuilder<T>
Sets the name of the JavaScript function that will be used as the status bar template handler for the grid.
public GridBuilder<T> StatusBarTemplateHandler(string template)
The name of the JavaScript function that will handle the status bar template.
Returns:GridBuilder<T>
public GridBuilder<T> TableHtmlAttributes(IDictionary<string, object> attributes)
GridBuilder<T>
public GridBuilder<T> TableHtmlAttributes(object attributes)
GridBuilder<T>
Sets toolbar template.
public GridBuilder<T> ToolBar(Action template)
The action defining the template.
Returns:GridBuilder<T>
Sets the toolbar template.
public GridBuilder<T> ToolBar(Action<Grid<T>> template)
The action defining the template.
Returns:GridBuilder<T>
Sets the toolbar configuration of the grid. Set the list of commands displayed in the Grid's Toolbar. Supports adding custom or built-in commands.
public GridBuilder<T> ToolBar(Action<GridToolBarCommandFactory<T>> configurator)
The lambda which configures the toolbar commands
Returns:GridBuilder<T>
Sets the toolbar configuration of the grid. Supports adding custom or built-in commands, configuring the toolbar overflow settings and adaptive editing settings.
public GridBuilder<T> ToolBar(Action<GridToolBarSettingsBuilder<T>> configurator)
The lambda which configures the toolbar settings.
Returns:GridBuilder<T>
Sets the toolbar template.
public GridBuilder<T> ToolBar(Func<Grid<T>, object> template)
The action defining the template.
Returns:GridBuilder<T>
Sets toolbar template. When a String value is assigned to the toolbar configuration option, it will be treated as a single string template for the whole Grid toolbar and the string value will be passed as an argument to a kendo.template() function.
public GridBuilder<T> ToolBar(string template)
The string template
Returns:GridBuilder<T>
Sets the toolbar template. Use the Template Component to configure the Toolbar.
public GridBuilder<T> ToolBar<TModel>(TemplateBuilder<TModel> template)
The template component which contains the template.
Returns:GridBuilder<T>
Sets the toolbar template. When 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 Grid Toolbar contents.
public GridBuilder<T> ToolBarClientTemplateHandler(string template)
The function handler which contains the template.
Returns:GridBuilder<T>
Sets the width of the grid.
public GridBuilder<T> Width(int pixelWidth)
The width of the Grid
Returns:GridBuilder<T>
Sets the width of the grid.
public GridBuilder<T> Width(string value)
The width of the Grid
Returns:GridBuilder<T>