ClassGridBase<TItem>
Definition
Namespace:Telerik.Blazor.Components.Common
Assembly:Telerik.Blazor.dll
Type Parameters:
TItem
Syntax:
public abstract class GridBase<TItem> : DataBoundComponent<TItem>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentDataBoundComponent<TItem>GridBase<TItem>
Derived Classes:
Implements:
Inherited Members
Constructors
GridBase()
Declaration
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.
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
[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).
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
[Parameter]
public EventCallback<int> PageChanged { get; set; }
Property Value
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.
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
[Parameter]
public EventCallback<int> PageSizeChanged { get; set; }
Property Value
Pageable
Enables page navigation controls for browsing large datasets by splitting them into smaller pages. Not compatible with virtual scrolling (Virtual).