skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI UI for Xamarin

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic FiddlerCap FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
  • Blazor Hybrid
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • Blazor Tutorials and Learning
    • First Stepswith Blazor Web Assembly
    • First Steps with Blazor Server
    • First Steps with Blazor Hybrid
    • Accessibility and Security
    • Submit a Ticket
    • FAQs

    Docs & Resources

    • Docs
    • Demos
    • Modernization and Migration
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs

    Productivity and Design Tools

    • REPL for Blazor
    • ThemeBuilder
    • Design System Documentation
    • Figma Kits
    • Visual Studio Extensions
    • Visual Studio Code Extensions
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class TelerikGrid<TItem>

The class for the Telerik Grid component.

Inheritance
System.Object
BaseComponent
DataBoundComponent<TItem>
GridBase<TItem>
TableGridBase<TItem, GridCommandEventArgs>
TelerikGrid<TItem>
Inherited Members
TableGridBase<TItem, GridCommandEventArgs>._selectedItemsMap
TableGridBase<TItem, GridCommandEventArgs>.OnAfterRender(Boolean)
TableGridBase<TItem, GridCommandEventArgs>.Dispose()
TableGridBase<TItem, GridCommandEventArgs>.SetMultiColumnHeaders()
TableGridBase<TItem, GridCommandEventArgs>.OnParametersSet()
TableGridBase<TItem, GridCommandEventArgs>.HandleVirtualScrollPaging()
TableGridBase<TItem, GridCommandEventArgs>.SetSkip(Int32)
TableGridBase<TItem, GridCommandEventArgs>.ResetEditContext()
TableGridBase<TItem, GridCommandEventArgs>.PageData()
TableGridBase<TItem, GridCommandEventArgs>.GetItemFromDropIndex(String)
TableGridBase<TItem, GridCommandEventArgs>.GetItemFromDropIndex(Int32)
TableGridBase<TItem, GridCommandEventArgs>.DialogFactory
TableGridBase<TItem, GridCommandEventArgs>.Id
TableGridBase<TItem, GridCommandEventArgs>.ColumnVirtualization
TableGridBase<TItem, GridCommandEventArgs>.AutoGenerateColumns
TableGridBase<TItem, GridCommandEventArgs>.Navigable
TableGridBase<TItem, GridCommandEventArgs>.RowTemplate
TableGridBase<TItem, GridCommandEventArgs>.NoDataTemplate
TableGridBase<TItem, GridCommandEventArgs>.Resizable
TableGridBase<TItem, GridCommandEventArgs>.Reorderable
TableGridBase<TItem, GridCommandEventArgs>.Sortable
TableGridBase<TItem, GridCommandEventArgs>.SortMode
TableGridBase<TItem, GridCommandEventArgs>.FilterMenuType
TableGridBase<TItem, GridCommandEventArgs>.SelectedItems
TableGridBase<TItem, GridCommandEventArgs>.SelectedItemsChanged
TableGridBase<TItem, GridCommandEventArgs>.EnableLoaderContainer
TableGridBase<TItem, GridCommandEventArgs>.RowDraggable
TableGridBase<TItem, GridCommandEventArgs>.ConfirmDelete
TableGridBase<TItem, GridCommandEventArgs>.RowHeight
TableGridBase<TItem, GridCommandEventArgs>.FilterRowDebounceDelay
TableGridBase<TItem, GridCommandEventArgs>.ShowColumnMenu
TableGridBase<TItem, GridCommandEventArgs>.OnCreate
TableGridBase<TItem, GridCommandEventArgs>.OnUpdate
TableGridBase<TItem, GridCommandEventArgs>.OnDelete
TableGridBase<TItem, GridCommandEventArgs>.OnEdit
TableGridBase<TItem, GridCommandEventArgs>.OnAdd
TableGridBase<TItem, GridCommandEventArgs>.OnCancel
GridBase<TItem>.Width
GridBase<TItem>.Height
GridBase<TItem>.PageSizeChanged
GridBase<TItem>.PageSize
GridBase<TItem>.Page
GridBase<TItem>.PageChanged
GridBase<TItem>.Pageable
GridBase<TItem>.OnModelInit
GridBase<TItem>.TotalCount
DataBoundComponent<TItem>.Rebind()
DataBoundComponent<TItem>.Data
BaseComponent.ShouldRender()
BaseComponent.OnInitializedAsync()
BaseComponent.InitLocalizer()
BaseComponent.ThrowIfParameterIsNull(Object, String)
BaseComponent.HaveOptionsChanged(IDictionary<String, Object>, IDictionary<String, Object>)
BaseComponent.GetClassString(String[])
BaseComponent.InvokeAsync<T>(String, Object[])
BaseComponent.InvokeAsync<T>(String, CancellationToken, Object[])
BaseComponent.InvokeVoidAsync(String, Object[])
BaseComponent.InvokeComponentMethodAsync<T>(String, Object[])
BaseComponent.InvokeComponentMethodAsync<T>(String, CancellationToken, Object[])
BaseComponent.InvokeVoidComponentMethodAsync(String, Object[])
BaseComponent.InvokeComponentVoidMethodAsync(String, Object)
BaseComponent.InvokeDisposeAsync()
BaseComponent.StateHasChanged()
BaseComponent.RootComponent
BaseComponent.Class
Namespace: Telerik.Blazor.Components
Assembly: Telerik.Blazor.dll

Syntax

public class TelerikGrid<TItem> : TableGridBase<TItem, GridCommandEventArgs>, IDisposable, IPagerContainer, IRowDraggableContainer, IValidationContainer, IPopupEditSettingsContainer, IGridContainer, IColumnContainer, IGridSelectionContainer
Type Parameters
TItem

The type of the model to which the grid is bound.

Constructors

TelerikGrid()

Declaration
public TelerikGrid()

Properties

DetailTemplate

Defines the detail template of the Grid for hierarchy scenarios.

Declaration
public RenderFragment<TItem> DetailTemplate { get; set; }
Property Value
Microsoft.AspNetCore.Components.RenderFragment<TItem>

EditMode

Defines the EditMode of the Grid. Supports None, Inline, Popup and Incell editing. The default mode is None.

Declaration
public GridEditMode EditMode { get; set; }
Property Value
GridEditMode

FilterMode

Defines if users can filter the Grid via header row or header menus. Supports FilterRow, FilterMenu and None (default).

Declaration
public GridFilterMode FilterMode { get; set; }
Property Value
GridFilterMode

GridExport

Defines the container tag for the Grid export configuration.

Declaration
public RenderFragment GridExport { get; set; }
Property Value
Microsoft.AspNetCore.Components.RenderFragment

GridPagerTemplate

Defines the template to be displayed instead of the default Pager.

Declaration
public RenderFragment GridPagerTemplate { get; set; }
Property Value
Microsoft.AspNetCore.Components.RenderFragment

GridSettings

Defines the container tag for additional Grid settings. See GridPagerSettings, GridPopupEditSettings, Telerik.Blazor.Components.GridRowDraggableSettings, GridSelectionSettings and Telerik.Blazor.Components.GridValidationSettings.

Declaration
public RenderFragment GridSettings { get; set; }
Property Value
Microsoft.AspNetCore.Components.RenderFragment

GridToolBarTemplate

Defines the toolbar template of the Grid.

Declaration
public RenderFragment GridToolBarTemplate { get; set; }
Property Value
Microsoft.AspNetCore.Components.RenderFragment

Groupable

Defines if users can group and ungroup the Grid, and if the group panel above the column headers is visible. Programmatic grouping via SetStateAsync(GridState<TItem>) is always possible.

Declaration
public bool Groupable { get; set; }
Property Value
System.Boolean

LoadGroupsOnDemand

Defines if groups will load on demand. When true, all groups will be initially collapsed. The default value is false.

Declaration
public bool LoadGroupsOnDemand { get; set; }
Property Value
System.Boolean

OnRead

Fires when the Grid requires items from the data source. Use this to attach your own logic for sorting, filtering, grouping and paging. Once OnRead is attached, you must implement all such data source operations here. The Component will no longer perform them for you.

Declaration
public EventCallback<GridReadEventArgs> OnRead { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridReadEventArgs>

OnRowClick

Fires when the user clicks on a row, or presses Enter while a row is focused.

Declaration
public EventCallback<GridRowClickEventArgs> OnRowClick { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowClickEventArgs>

OnRowCollapse

Fires when the user collapses a row in hierarchy scenarios.

Declaration
public EventCallback<GridRowCollapseEventArgs> OnRowCollapse { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowCollapseEventArgs>

OnRowContextMenu

Fires when the user triggers a contextmenu event with click or context menu button.

Declaration
public EventCallback<GridRowClickEventArgs> OnRowContextMenu { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowClickEventArgs>

OnRowDoubleClick

Fires when the user double-clicks on a row.

Declaration
public EventCallback<GridRowClickEventArgs> OnRowDoubleClick { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowClickEventArgs>

OnRowDrop

Fires when the user drops a dragged Grid row. RowDraggable must be enabled.

Declaration
public EventCallback<GridRowDropEventArgs<TItem>> OnRowDrop { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowDropEventArgs<TItem>>

OnRowExpand

Fires when the user expands a row in hierarchy scenarios.

Declaration
public EventCallback<GridRowExpandEventArgs> OnRowExpand { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowExpandEventArgs>

OnRowRender

Fires each time a row is rendered. Use this to add custom CSS classes to the row based on the data item.

Declaration
public Action<GridRowRenderEventArgs> OnRowRender { get; set; }
Property Value
System.Action<GridRowRenderEventArgs>

OnStateChanged

Fires on user interaction that causes changes in the GridState<TItem>.

Declaration
public EventCallback<GridStateEventArgs<TItem>> OnStateChanged { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridStateEventArgs<TItem>>

OnStateInit

Invoked when the Grid is initialized and state could be loaded. Useful when you'd like to persist changed on page reloads.

Declaration
public EventCallback<GridStateEventArgs<TItem>> OnStateInit { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridStateEventArgs<TItem>>

ScrollMode

Defines scrolling mode of the Grid. Possible values are Scrollable and Virtual.

Declaration
public GridScrollMode ScrollMode { get; set; }
Property Value
GridScrollMode

SelectedCells

Defines the collection of selected cells. The parameter supports two-way binding. Also set SelectionMode.

Declaration
public IEnumerable<GridSelectedCellDescriptor> SelectedCells { get; set; }
Property Value
System.Collections.Generic.IEnumerable<GridSelectedCellDescriptor>

SelectedCellsChanged

The event fires when users select or unselect cell.

Declaration
public EventCallback<IEnumerable<GridSelectedCellDescriptor>> SelectedCellsChanged { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<System.Collections.Generic.IEnumerable<GridSelectedCellDescriptor>>

SelectionMode

Defines the Selection Mode of the Grid.

Declaration
public GridSelectionMode SelectionMode { get; set; }
Property Value
GridSelectionMode

Size

Specifies the density of the Grid data rows, including cell padding. Default value is Medium.

Declaration
public string Size { get; set; }
Property Value
System.String

Methods

AutoFitAllColumnsAsync()

Sets the minimum possible widths to all Grid columns, so that there is no text wrapping.

Declaration
public Task AutoFitAllColumnsAsync()
Returns
System.Threading.Tasks.Task

AutoFitColumnAsync(String)

Sets the minimum possible width to a Grid column, so that there is no text wrapping.

Declaration
public Task AutoFitColumnAsync(string id)
Parameters
System.String id

The Id value of the column to autofit.

Returns
System.Threading.Tasks.Task

AutoFitColumnsAsync(IEnumerable<String>)

Sets the minimum possible widths to multiple Grid columns, so that there is no text wrapping.

Declaration
public Task AutoFitColumnsAsync(IEnumerable<string> ids)
Parameters
System.Collections.Generic.IEnumerable<System.String> ids

The Id values of the columns to autofit.

Returns
System.Threading.Tasks.Task

BuildRenderTree(RenderTreeBuilder)

Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

Dispose()

Declaration
public override void Dispose()
Overrides
Telerik.Blazor.Components.Common.TableGridBase<TItem, Telerik.Blazor.Components.GridCommandEventArgs>.Dispose()

ExportToCsvAsync()

Exports the Grid to a System.IO.MemoryStream that can be saved as a CSV file.

Declaration
public Task<MemoryStream> ExportToCsvAsync()
Returns
System.Threading.Tasks.Task<System.IO.MemoryStream>

ExportToExcelAsync()

Exports the Grid to a System.IO.MemoryStream that can be saved as an Excel file.

Declaration
public Task<MemoryStream> ExportToExcelAsync()
Returns
System.Threading.Tasks.Task<System.IO.MemoryStream>

GetItemFromDropIndex(Int32)

Declaration
protected override TItem GetItemFromDropIndex(int index)
Parameters
System.Int32 index

Returns
TItem

Overrides
Telerik.Blazor.Components.Common.TableGridBase<TItem, Telerik.Blazor.Components.GridCommandEventArgs>.GetItemFromDropIndex(System.Int32)

GetState()

Gets the current state of the Grid. Includes grouping, filtering, edit items, column state, etc.

Declaration
public GridState<TItem> GetState()
Returns
GridState<TItem>

Instance of a GridState<TItem> class that contains all data.

OnAfterRenderAsync(Boolean)

Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
System.Boolean firstRender

Returns
System.Threading.Tasks.Task

Overrides
BaseComponent.OnAfterRenderAsync(Boolean)

OnParametersSetAsync()

Declaration
protected override Task OnParametersSetAsync()
Returns
System.Threading.Tasks.Task

Overrides
Telerik.Blazor.Components.Common.DataBoundComponent<TItem>.OnParametersSetAsync()

PageData()

Declaration
protected override Task PageData()
Returns
System.Threading.Tasks.Task

Overrides
Telerik.Blazor.Components.Common.TableGridBase<TItem, Telerik.Blazor.Components.GridCommandEventArgs>.PageData()

SaveAsCsvFileAsync()

Exports the Grid to a file and sends it to the browser for download.

Declaration
public ValueTask SaveAsCsvFileAsync()
Returns
System.Threading.Tasks.ValueTask

SaveAsExcelFileAsync()

Exports the grid to a file and sends it to the browser for download.

Declaration
public ValueTask SaveAsExcelFileAsync()
Returns
System.Threading.Tasks.ValueTask

SetParametersAsync(ParameterView)

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Microsoft.AspNetCore.Components.ParameterView parameters

Returns
System.Threading.Tasks.Task

Overrides
Telerik.Blazor.Components.Common.DataBoundComponent<TItem>.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView)

SetSkip(Int32)

Declaration
protected override void SetSkip(int skip)
Parameters
System.Int32 skip

Overrides
Telerik.Blazor.Components.Common.TableGridBase<TItem, Telerik.Blazor.Components.GridCommandEventArgs>.SetSkip(System.Int32)

SetStateAsync(GridState<TItem>)

Changes the state of the Grid. Includes all properties, which are controlled by the user - grouping, filtering, edit items, column state, etc.

Declaration
public Task SetStateAsync(GridState<TItem> state)
Parameters
GridState<TItem> state

Returns
System.Threading.Tasks.Task

Getting Started
  • Client-side Blazor
  • Server-side Blazor
  • Demos
Community
  • Forums
  • Blogs
  • Feedback Portal
Support Resources
  • Demos
  • Knowledge Base
  • Samples Repo
  • Localizations Repo
Sample Applications
  • Dashboard
  • PWA - Stocks
  • PWA - Blazing Coffee Roasters

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.