Posted 10 January 2024, 7:30 pm EST - Updated 10 January 2024, 8:12 pm EST
I’m trying to group,with aggrigation, about 100,000 records that are comming from database. I have done it but its taking too long to fetch all the records. Hence I’m trying to implement Virtualization with where filter in that but couldn’t find a way to do it.
{
var lastDay = DateTime.DaysInMonth(date.Year, date.Month);
date = new DateTime(date.Year, date.Month, lastDay);
List<DataGridModel>? gridData = DataSource.GetGridData(date);
dataGrid.DataSource = gridData;
dataGrid.Tree.Column = 1;
// clear existing totals
dataGrid.Subtotal(AggregateEnum.Clear);
// calculate subtotals (three levels, totals on every column)
for (int c = 4; c < dataGrid.Cols.Count; c++)
{
//dataGrid.Subtotal(AggregateEnum.Sum, 0, -1, c, "Grand Total");
dataGrid.Subtotal(AggregateEnum.Sum, 1, 1, c, "Total for {0}");
dataGrid.Subtotal(AggregateEnum.Sum, 2, 2, c, "Total for {0}");
}
// done, autosize columns to finish
dataGrid.AutoSizeCols();
}