Hi Mohammed
Greeting from Syncfusion support,
Query:” I need a
way to set the grid total count”
Based on your query, we suggest that you use the count method from the grid instance to get the total count from the datasource.
Please see the attached code snippet for reference.
<SfGrid DataSource="@OrderData.GetAllOrders()"TValue="Order"ID="Grid"
@ref="Grid"
Toolbar="@ToolbarItems"
AllowSorting="true"
AllowFiltering="true"
AllowPaging="true">
<GridPageSettings PageSize="10"></GridPageSettings>
<GridEditSettings AllowAdding="true"
AllowDeleting="true"
AllowEditing="true">
</GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true"
TextAlign="TextAlign.Right" Width="120">
</GridColumn>
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer
Name" Width="150"></GridColumn>
</GridColumns>
</SfGrid>
@code{
SfGrid<Order>
Grid;
var count =
Grid.DataSource.Count();
}
|
Please get back to us for further details.
Regards,
Prathap S