Class
GridBase<TItem>

Definition

Namespace:Telerik.Blazor.Components.Common

Assembly:Telerik.Blazor.dll

Type Parameters:

TItem

Syntax:

cs-api-definition
public abstract class GridBase<TItem> : DataBoundComponent<TItem>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentDataBoundComponent<TItem>GridBase<TItem>

Derived Classes: TableGridBase<TItem, TCommandEventArgs>TelerikListView<TItem>

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members DataBoundComponent<TItem>.SetParametersAsync(ParameterView)DataBoundComponent<TItem>.OnParametersSetAsync()DataBoundComponent<TItem>.Dispose()DataBoundComponent<TItem>.Rebind()DataBoundComponent<TItem>.DataBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.OnAfterRenderAsync(bool)BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.BuildRenderTree(RenderTreeBuilder)ComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)

Constructors

GridBase()

Declaration

cs-api-definition
protected GridBase()

Properties

Height

Sets the overall height of the Grid component using CSS units. Use pixels ("400px"), viewport units ("50vh"), or other CSS values to control vertical space.

Declaration

cs-api-definition
[Parameter]
public string Height { get; set; }

Property Value

string

OnModelInit

Provides a custom factory method for creating new data item instances during add operations. Essential when your model lacks a parameterless constructor. If not provided, Activator.CreateInstance is used to create new instances automatically. Use this to initialize default values, set required properties, or handle complex object construction.

Declaration

cs-api-definition
[Parameter]
public Func<TItem> OnModelInit { get; set; }

Property Value

Func<TItem>

Page

Sets the currently active page number for navigation. Use 1-based indexing where 1 is the first page. Only applies when Pageable is enabled. Default value is 1 (first page).

Declaration

cs-api-definition
[Parameter]
public virtual int Page { get; set; }

Property Value

int

PageChanged

Fires when the user navigates to a different page using pagination controls. Use this to track page changes. Only triggered when Pageable is enabled.

Declaration

cs-api-definition
[Parameter]
public EventCallback<int> PageChanged { get; set; }

Property Value

EventCallback<int>

PageSize

Sets how many data items to display on each page when pagination is enabled. Controls the granularity of data presentation and affects performance. Must be greater than 0. Only applies when Pageable is true.

Declaration

cs-api-definition
[Parameter]
public int PageSize { get; set; }

Property Value

int

PageSizeChanged

Fires when the user selects a different page size from the pager dropdown. Use this to respond to page size changes and update data accordingly.

Declaration

cs-api-definition
[Parameter]
public EventCallback<int> PageSizeChanged { get; set; }

Property Value

EventCallback<int>

Pageable

Enables page navigation controls for browsing large datasets by splitting them into smaller pages. Not compatible with virtual scrolling (Virtual).

Declaration

cs-api-definition
[Parameter]
public bool Pageable { get; set; }

Property Value

bool

TotalCount

Declaration

cs-api-definition
protected virtual int TotalCount { get; set; }

Property Value

int

Width

Sets the overall width of the Grid component using CSS units. Use pixels ("400px"), percentages ("100%"), or other CSS values to control horizontal space.

Declaration

cs-api-definition
[Parameter]
public string Width { get; set; }

Property Value

string