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

Grid<T>

Class

The server side wrapper for Kendo UI Grid

Definition

Constructors

C#
public Grid(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator, IGridHtmlBuilderFactory htmlBuilderFactory)
Parameters:viewContextViewContextinitializerIJavaScriptInitializerurlGeneratorIUrlGeneratorhtmlBuilderFactoryIGridHtmlBuilderFactory

Properties

Specifies the adaptive rendering of the component.

C#
public AdaptiveMode? AdaptiveMode { get; set; }
C#
public IEnumerable<AggregateDescriptor> Aggregates { get; }

Defines the configuration options for the AI tools in the Grid.

C#
public GridAiSettings<T> Ai { get; }
C#
public AllowCopySettings AllowCopy { get; set; }
C#
public bool? AllowPaste { get; set; }
C#
public bool? AutoBind { get; set; }
C#
public bool AutoGenerateColumns { get; set; }

Gets or sets the action executed when rendering a cell.

C#
public Action<GridCell<T>> CellAction { get; set; }
C#
public string ClientAltRowTemplate { get; set; }
C#
public string ClientAltRowTemplateHandler { get; set; }
C#
public string ClientDetailTemplateHandler { get; set; }
C#
public string ClientDetailTemplateId { get; set; }
C#
public string ClientRowTemplate { get; set; }
C#
public string ClientRowTemplateHandler { get; set; }

Gets the column menu configuration.

C#
public GridColumnMenuSettings ColumnMenu { get; }

Implements: IGrid.ColumnMenu

C#
public int ColumnResizeHandleWidth { get; set; }

Gets the columns of the grid.

C#
public IList<GridColumnBase<T>> Columns { get; }

Implements: IGridColumnContainer<T>.Columns

C#
public GridContextMenuSettings ContextMenu { get; }
C#
public int CurrentPage { get; }

Defines the data layout mode of the grid.

C#
public DataLayoutMode? DataLayoutMode { get; set; }
C#
public DataSource DataSource { get; }

Implements: IGrid.DataSource

C#
public string DataSourceId { get; set; }

Implements: IGrid.DataSourceId

C#
public HtmlTemplate<T> DetailTemplate { get; }
C#
public GridEditableSettings<T> Editable { get; }
C#
public string EditorHtml { get; set; }

Implements: IGrid.EditorHtml

Gets or sets a value indicating whether custom binding is enabled.

C#
public bool EnableCustomBinding { get; set; }
Property Value:

true if custom binding is enabled; otherwise, false. The default value is false

Implements: IGrid.EnableCustomBinding

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.

C#
public bool? EncodeTitles { get; set; }
C#
public GridExcelSettings Excel { get; }

Gets the filtering configuration.

C#
public GridFilterableSettings Filterable { get; }

Implements: IGrid.Filterable

C#
public GridGroupableSettings Grouping { get; }

Implements: IGrid.Grouping

C#
public bool HasDetailTemplate { get; }

Implements: IGrid.HasDetailTemplate

C#
public string Height { get; set; }
C#
public bool IsClientBinding { get; }
C#
public bool IsEmpty { get; set; }

Defines the type of the loader that will be displayed while loading the data

C#
public GridLoaderType? LoaderType { get; set; }
C#
public GridMessages Messages { get; }
C#
public MobileMode Mobile { get; set; }

Gets the keyboard navigation configuration.

C#
public GridNavigatableSettings Navigatable { get; }
C#
public GridNoRecordsSettings NoRecords { get; set; }
C#
public HtmlTemplate NoRecordsTemplate { get; }

Gets the paging configuration.

C#
public GridPageableSettings Pageable { get; }

Implements: IGrid.Pageable

Gets the page size of the grid.

C#
public int PageSize { get; }
C#
public PDFSettings Pdf { get; }
C#
public bool? PersistSelection { get; set; }
C#
public GridPinnableSettings Pinnable { get; }
C#
public string PinnedRowTemplateHandler { get; set; }

Gets or sets a value indicating whether to add the Name property of the grid as a prefix in url parameters.

C#
public bool PrefixUrlParameters { get; set; }
Property Value:

true if prefixing is enabled; otherwise, false. The default value is true

C#
public GridReorderableSettings Reorderable { get; }
C#
public GridResizableSettings Resizable { get; }

Gets or sets the action executed when rendering a row.

C#
public Action<GridRow<T>> RowAction { get; set; }

Gets the template which the grid will use to render a row

C#
public HtmlTemplate<T> RowTemplate { get; }

Gets the scrolling configuration.

C#
public GridScrollableSettings Scrollable { get; }

Implements: IGrid.Scrollable

Configures the Kendo UI Grid search bar settings.

C#
public GridSearchSettings<T> Search { get; }

Gets the selection configuration

C#
public GridSelectableSettings Selectable { get; }
C#
public bool ShowGroupHeaderColumn { get; }
C#
public ComponentSize Size { get; set; }

Implements: IGrid.Size

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.

C#
public GridSmartBoxSettings<T> SmartBox { get; }

Gets the sorting configuration.

C#
public GridSortableSettings Sortable { get; }
Property Value:

The sorting.

Implements: IGrid.Sortable

The stacked layout settings of the Grid.

C#
public GridStackedLayoutSettingsSettings StackedLayoutSettings { get; }
C#
public string StatusBarTemplate { get; set; }
C#
public string StatusBarTemplateHandler { get; set; }
C#
public IDictionary<string, object> TableHtmlAttributes { get; }
C#
public GridToolBarSettings<T> ToolBar { get; }
C#
public IGridUrlBuilder UrlBuilder { get; }
C#
public IUrlGenerator UrlGenerator { get; }

Implements: IGrid.UrlGenerator

C#
public IDictionary<string, object> ValidationMetadata { get; }
C#
public string Width { get; set; }

Methods

Insert Create button

C#
public object CreateButton()
Returns:

object

Insert Create button with custom HtmlAttributes

C#
public object CreateButton(object htmlAttributes)
Parameters:htmlAttributesobjectReturns:

object

Insert Create button with custom HtmlAttributes and text

C#
public object CreateButton(string text, object htmlAttributes)
Parameters:textstringhtmlAttributesobjectReturns:

object

Insert Create button with custom text

C#
public object CreateButton(string text)
Parameters:textstringReturns:

object

C#
public object CustomCommandToolBarButton(string name, string text, object htmlAttributes)
Parameters:namestringtextstringhtmlAttributesobjectReturns:

object

C#
public object CustomCommandToolBarButton(string name, string text, string url, object htmlAttributes)
Parameters:namestringtextstringurlstringhtmlAttributesobjectReturns:

object

C#
public object CustomCommandToolBarButton(string name, string text, string routeName, RouteValueDictionary routeValues, object htmlAttributes)
Parameters:namestringtextstringrouteNamestringrouteValuesRouteValueDictionaryhtmlAttributesobjectReturns:

object

C#
public object CustomCommandToolBarButton(string name, string text, string actionName, string controllerName, object routeValues, object htmlAttributes)
Parameters:namestringtextstringactionNamestringcontrollerNamestringrouteValuesobjecthtmlAttributesobjectReturns:

object

C#
public object CustomCommandToolBarButton(string name, string text, string actionName, string controllerName, object routeValues)
Parameters:namestringtextstringactionNamestringcontrollerNamestringrouteValuesobjectReturns:

object

C#
public object CustomCommandToolBarButton(string name, string text, string url)
Parameters:namestringtextstringurlstringReturns:

object

C#
public object CustomCommandToolBarButton(string name, string text)
Parameters:namestringtextstringReturns:

object

Insert Destroy button with custom HtmlAttributes

C#
public object DestroyButton(T dataItem, object htmlAttributes)
Parameters:dataItemThtmlAttributesobjectReturns:

object

Insert Destroy button with custom HtmlAttributes and text

C#
public object DestroyButton(T dataItem, string text, object htmlAttributes)
Parameters:dataItemTtextstringhtmlAttributesobjectReturns:

object

Insert Destroy button with custom text

C#
public object DestroyButton(T dataItem, string text)
Parameters:dataItemTtextstringReturns:

object

Insert Destroy button

C#
public object DestroyButton(T dataItem)
Parameters:dataItemTReturns:

object

C#
public object EditButton(T dataItem, object htmlAttributes)
Parameters:dataItemThtmlAttributesobjectReturns:

object

C#
public object EditButton(T dataItem, string text, object htmlAttributes)
Parameters:dataItemTtextstringhtmlAttributesobjectReturns:

object

C#
public object EditButton(T dataItem, string text)
Parameters:dataItemTtextstringReturns:

object

C#
public object EditButton(T dataItem)
Parameters:dataItemTReturns:

object

C#
public string Prefix(string value)
Parameters:valuestringReturns:

string

Implements: IGrid.Prefix(string)

Insert Save button

C#
public object SaveButton()
Returns:

object

Insert Save button with custom HtmlAttributes

C#
public object SaveButton(object htmlAttributes)
Parameters:htmlAttributesobjectReturns:

object

Insert Save button with custom HtmlAttributes and texts

C#
public object SaveButton(string saveText, string cancelText, object htmlAttributes)
Parameters:saveTextstringcancelTextstringhtmlAttributesobjectReturns:

object

Insert Save button with custom save and cancel text

C#
public object SaveButton(string saveText, string cancelText)
Parameters:saveTextstringcancelTextstringReturns:

object

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: WidgetBase.Serialize()

C#
public override void VerifySettings()

Overrides: WidgetBase.VerifySettings()

Writes the HTML.

C#
protected override void WriteHtml(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: WidgetBase.WriteHtml(HtmlTextWriter)

Writes the initialization script.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

The writer.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)

In this article
DefinitionConstructorsGrid(ViewContext, IJavaScriptInitializer, IUrlGenerator, IGridHtmlBuilderFactory)PropertiesAdaptiveModeAggregatesAiAllowCopyAllowPasteAutoBindAutoGenerateColumnsCellActionClientAltRowTemplateClientAltRowTemplateHandlerClientDetailTemplateHandlerClientDetailTemplateIdClientRowTemplateClientRowTemplateHandlerColumnMenuColumnResizeHandleWidthColumnsContextMenuCurrentPageDataLayoutModeDataSourceDataSourceIdDetailTemplateEditableEditorHtmlEnableCustomBindingEncodeTitlesExcelFilterableGroupingHasDetailTemplateHeightIsClientBindingIsEmptyLoaderTypeMessagesMobileNavigatableNoRecordsNoRecordsTemplatePageablePageSizePdfPersistSelectionPinnablePinnedRowTemplateHandlerPrefixUrlParametersReorderableResizableRowActionRowTemplateScrollableSearchSelectableShowGroupHeaderColumnSizeSmartBoxSortableStackedLayoutSettingsStatusBarTemplateStatusBarTemplateHandlerTableHtmlAttributesToolBarUrlBuilderUrlGeneratorValidationMetadataWidthMethodsCreateButton()CreateButton(object)CreateButton(string, object)CreateButton(string)CustomCommandToolBarButton(string, string, object)CustomCommandToolBarButton(string, string, string, object)CustomCommandToolBarButton(string, string, string, RouteValueDictionary, object)CustomCommandToolBarButton(string, string, string, string, object, object)CustomCommandToolBarButton(string, string, string, string, object)CustomCommandToolBarButton(string, string, string)CustomCommandToolBarButton(string, string)DestroyButton(T, object)DestroyButton(T, string, object)DestroyButton(T, string)DestroyButton(T)EditButton(T, object)EditButton(T, string, object)EditButton(T, string)EditButton(T)Prefix(string)SaveButton()SaveButton(object)SaveButton(string, string, object)SaveButton(string, string)Serialize()VerifySettings()WriteHtml(HtmlTextWriter)WriteInitializationScript(TextWriter)
Not finding the help you need?
Contact Support