We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to get the group counter after filtering?

Hi,

I have a requirement to get the number of group in the sfDataGrid after doing a filter. I have tried the property sfDataGrid.View.Groups.Count, but this property does not change after filtering.

Can you please suggest what the proper way 

1 Reply

JG Jai Ganesh S Syncfusion Team January 18, 2017 09:57 AM UTC

Hi Yong, 
You can get the groups count after Filtering by using the below code, 
private void Button_Click(object sender, RoutedEventArgs e) 
{ 
    int groupCount = 0; 
 
    foreach(var group in datagrid.View.Groups) 
    { 
        if((group as Group).Records.Count>0) 
            groupCount = groupCount+1; 
    } 
 
} 
 
Regards, 
Jai Ganesh S 


Loader.
Live Chat Icon For mobile
Up arrow icon