Class TelerikGrid<TItem>
The class for the Telerik Grid component.
Inheritance
Inherited Members
Namespace: Telerik.Blazor.Components
Assembly: Telerik.Blazor.dll
Syntax
public class TelerikGrid<TItem> : TableGridBase<TItem, GridCommandEventArgs>, IDisposable, IPagerContainer, IRowDraggableContainer, IValidationContainer, IPopupEditSettingsContainer, IGridContainer, IColumnContainer
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.
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 Option is None.
Declaration
public GridEditMode EditMode { get; set; }
Property Value
GridEditMode
|
FilterMode
Defines the Filter Mode of the Grid.
Declaration
public GridFilterMode FilterMode { get; set; }
Property Value
GridFilterMode
|
GridExport
Defines the export configuration.
Declaration
public RenderFragment GridExport { get; set; }
Property Value
Microsoft.AspNetCore.Components.RenderFragment
|
GridPagerTemplate
Defines the template that will be displayed instead of the Pager.
Declaration
public RenderFragment GridPagerTemplate { get; set; }
Property Value
Microsoft.AspNetCore.Components.RenderFragment
|
GridSettings
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 whether the Grid is groupable.
Declaration
public bool Groupable { get; set; }
Property Value
System.Boolean
|
LoadGroupsOnDemand
Defines whether groups should be loaded on demand.
Declaration
public bool LoadGroupsOnDemand { get; set; }
Property Value
System.Boolean
|
OnRead
Fires when the data source is read. Use this to attach your own paging, sorting and filtering logic. Once 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.
Declaration
public EventCallback<GridRowClickEventArgs> OnRowClick { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowClickEventArgs>
|
OnRowCollapse
Fires when the user collapses a row using mouse or keyboard.
Declaration
public EventCallback<GridRowCollapseEventArgs> OnRowCollapse { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowCollapseEventArgs>
|
OnRowContextMenu
Fires when the user triggers 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
Fired when a row is dropped.
Declaration
public EventCallback<GridRowDropEventArgs<TItem>> OnRowDrop { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowDropEventArgs<TItem>>
|
OnRowExpand
Fires when the user expands a row using mouse or keyboard.
Declaration
public EventCallback<GridRowExpandEventArgs> OnRowExpand { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<GridRowExpandEventArgs>
|
OnRowRender
Called each time a row is rendered. Use this to add custom 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
|
SelectionMode
Defines the Selection Mode of the Grid.
Declaration
public GridSelectionMode SelectionMode { get; set; }
Property Value
GridSelectionMode
|
ShowColumnMenu
Specifies if the column menu will be visible.
Declaration
public bool ShowColumnMenu { get; set; }
Property Value
System.Boolean
|
Size
Specifies the Size of the grid. Default value is Medium.
Declaration
public string Size { get; set; }
Property Value
System.String
|
Methods
AutoFitAllColumns()
Declaration
public void AutoFitAllColumns()
AutoFitAllColumnsAsync()
Declaration
public Task AutoFitAllColumnsAsync()
Returns
System.Threading.Tasks.Task
|
AutoFitColumn(String)
Declaration
public void AutoFitColumn(string id)
Parameters
System.String
id
|
AutoFitColumnAsync(String)
Declaration
public Task AutoFitColumnAsync(string id)
Parameters
System.String
id
|
Returns
System.Threading.Tasks.Task
|
AutoFitColumns(IEnumerable<String>)
Declaration
public void AutoFitColumns(IEnumerable<string> ids)
Parameters
System.Collections.Generic.IEnumerable<System.String>
ids
|
AutoFitColumnsAsync(IEnumerable<String>)
Declaration
public Task AutoFitColumnsAsync(IEnumerable<string> ids)
Parameters
System.Collections.Generic.IEnumerable<System.String>
ids
|
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
ExportToCsvAsync()
Exports the grid to a stream 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 stream 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
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
OnParametersSetAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
System.Threading.Tasks.Task
|
Overrides
PageData()
Declaration
protected override Task PageData()
Returns
System.Threading.Tasks.Task
|
Overrides
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
SetStateAsync(GridState<TItem>)
Sets the state of the Grid. Includes grouping, filtering, edit items, column state, etc.
Declaration
public Task SetStateAsync(GridState<TItem> state)
Parameters
GridState<TItem>
state
|
Returns
System.Threading.Tasks.Task
|