Category / Section
How to get the filtered records count while adding, deleting or any filtering operations in WinForms GridGroupingControl?
1 min read
Adding and deleting the value from filtered records
To get the filtered records while adding, deleting and filtering the records in the grid, the CategorizedRecords event can be used. In that event, FilteredRecords.Count property can be used to get the filtered records count.
C#
//Event Triggering
this.gridGroupingControl1.Table.CategorizedRecords += Table_CategorizedRecords;
//Event Customization
private void Table_CategorizedRecords(object sender, TableEventArgs e)
{
this.label1.Text= "Filtered Records count :\n" + e.Table.FilteredRecords.Count;
}
VB
'Event Triggering
AddHandler Me.gridGroupingControl1.Table.CategorizedRecords, AddressOf Table_CategorizedRecords
'Event Customization
Private Sub Table_CategorizedRecords(ByVal sender As Object, ByVal e As TableEventArgs)
Me.label1.Text = "Filtered Records count :" & e.Table.FilteredRecords.Count
End Sub
The
Screenshot below illustrates the filtering of records in GridGroupingControl
Samples: