<EjsGrid id="Grid" @ref="@defaultGrid" DataSource="@gridData" AllowPaging="true">
<GridPageSettings PageSize="5"></GridPageSettings>
<GridColumns>
<GridColumn Field=@nameof(OrdersDetails.OrderID) HeaderText="Order ID" TextAlign="@TextAlign.Right" Width="120"></GridColumn>
. . . .
</GridColumns>
</EjsGrid>
@functions{
EjsGrid defaultGrid;
public object gridData { get; set; }
protected override void OnAfterRender()
{
base.OnAfterRender();
this.defaultGrid.DataSource = OrdersDetails.GetAllRecords().ToList();
gridData = this.defaultGrid.DataSource;
}
} |