<EjsGrid id="Grid" DataSource="@gridData" AllowPaging="true">
<GridPageSettings PageSize="5"></GridPageSettings>
<GridColumns>
<GridColumn Field=@nameof(OrdersDetails.OrderID) HeaderText="Order ID" TextAlign="@TextAlign.Right" Width="120"></GridColumn>
<GridColumn HeaderText=" Order Details" Columns="@( new List<@GridColumn>(){
new Syncfusion.EJ2.RazorComponents.Grids.GridColumn{ Field = nameof(OrdersDetails.OrderDate), HeaderText = "Order Date", Format="yMd" },
new Syncfusion.EJ2.RazorComponents.Grids.GridColumn { Field = nameof(OrdersDetails.Freight), HeaderText = "Freight($)", Format="C2" } } )">
</GridColumn>
. . . . .
</GridColumns>
</EjsGrid>
@functions{
public List<OrdersDetails> gridData { get; set; }
protected override void OnInit()
{
gridData = OrdersDetails.GetAllRecords();
}
}
|