I am trying to get a count of the filtered records in an sfDataGrid. However, when I use the event and code below, the value returned is the count of the total in the datasource, not the filtered count.
private void TransactionHistoryListDataGrid_FilterChanged(object sender, Syncfusion.WinForms.DataGrid.Events.FilterChangedEventArgs e)
{
var filteredRecords = TransactionHistoryListDataGrid.View.Records.Select(x => x.Data).Count();
ShowFilteredRecordCount(filteredRecords);
}
I also tried
var filteredRecords = TransactionHistoryListDataGrid.View.Records..Count; but got the same results.
For example, when I initially populate the grid from the datasource, it this example, I would see total records in the datasource result as 36. But when the user applies a column filter, in this example, finding one 1 qualifying record, the result of the code above still shows 36 records.
What am I missing?
Attachment:
SyncFusion_Screenshots_beefcbb9.zip