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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the group counter after filtering?

Thread ID:

Created:

Updated:

Platform:

Replies:

128376 Jan 17,2017 08:15 PM UTC Jan 18,2017 09:57 AM UTC WPF 1
loading
Tags: SfDataGrid
Yong
Asked On January 17, 2017 08:15 PM UTC

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 

Jai Ganesh S [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;