|
<GridAggregates>
<GridAggregate>
<GridAggregateColumns>
<GridAggregateColumn Field=@nameof(Product.UnitsInStock) Type="AggregateType.Custom">
<FooterTemplate>
@{
var aggregate = (context as AggregateTemplateContext);
<div>
<p>Weighted Aggregate: @GetWeightedAggregate() </p>
</div>
}
</FooterTemplate>
</GridAggregateColumn>
</GridAggregateColumns>
</GridAggregate>
</GridAggregates>
@code{
public string WeightedAggregate = "";
//Custom Aggregate Function
public string GetWeightedAggregate()
{
return Queryable.Sum(Products.Select(x=>x.UnitsInStock * x.UnitsInStock1).AsQueryable()).ToString("N4");
}
} |
Hello
I used CustomAggregate.
In the DataGrid, I use paging and filter. Suppose the DataGrid has 1000 rows, after the filter, 500 rows are displayed in the DataGrid on several pages. In GetCurrentViewRecordsAsync(), the output of this function is only the rows of the current page. How can I get 500 rows?
Hi Sarh,
Based on your query, we would like
to inform you that the GetCurrentViewRecordsAsync method returns only the data
present in the current page of the DataGrid. If paging is applied in the
DataGrid, it will retrieve the current view records. This behavior is the
default of the grid and it's not feasible to retrieve all records using the
GetCurrentViewRecordsAsync method. Thank you for your understanding.
Regards,
Prathap S
Hi Prathap Senthil,
Thank you for your attention
How can I get all records displayed on all pages?
We would like to inform you
that when using paging, initially, you will receive the current view records in
the grid's data source. Subsequent sets of records will be loaded when
moving to the next page. The grid's paging feature operates based on the
skip-and-take values for on-demand loading. Therefore, it's not feasible
to fulfill your requirement of retrieving the entire records for all pages.
This is the default behavior of the grid. Thank you for your understanding.
It is suggested to put a function to get all the records available on all the pages.
Without this function, we cannot know about the records that are displayed on the user's side.
We understand your requirement for a function to retrieve all records available
on all pages in the Syncfusion Blazor DataGrid. However ,As mentioned in our
previous communication, the DataGrid's paging feature operates on-demand
loading based on skip-and-take values. While we understand the importance of
having visibility into all records for certain scenarios, retrieving all
records from all pages simultaneously might not be feasible due to performance
and resource constraints, especially with large datasets. Thank you for your
understanding of this limitation.