)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add filters from one TreeView node to another TreeView node in WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: February 15, 2016 |
Last Revised Date: January 2, 2020

Filtering

In order to add the Record Filters from one Tree View node to another Tree View node, need to add the same filter condition to each grid in the tree view node.

C#

//Used to save the objects of all grids
List<GridGroupingControl> grids = new List<GridGroupingControl>();
 
//add the grid to the list
grids.Add(GridGroup);
 
void RecordFilters_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e)
{
   Syncfusion.Grouping.RecordFilterDescriptorCollection filters =  sender as RecordFilterDescriptorCollection;
   foreach (GridGroupingControl grid in grids)
   {
      foreach(RecordFilterDescriptor filter in filters)
      {
       //To avoid the repeated objects from the list
       if (grid.TableDescriptor.RecordFilters.Contains(filter)) 
          continue;
      grid.TableDescriptor.RecordFilters.Add(filter);
     }
   }
}

 

VB

'Used to save the objects of all grids
Private grids As New List(Of GridGroupingControl)()
 
‘add the grid to the list
grids.Add(GridGroup)
 
Private Sub RecordFilters_Changed(ByVal sender As Object, ByVal e As Syncfusion.Collections.ListPropertyChangedEventArgs)
   Dim filters As Syncfusion.Grouping.RecordFilterDescriptorCollection = TryCast(sender, RecordFilterDescriptorCollection)
   For Each grid As GridGroupingControl In grids
      For Each filter As RecordFilterDescriptor In filters
         If grid.TableDescriptor.RecordFilters.Contains(filter) Then
            Continue For
         End If
         grid.TableDescriptor.RecordFilters.Add(filter)
      Next filter
  Next grid
End Sub

 

Screenshot

Add filters from one TreeView node to another node

Samples:

C#: Add RecordFilterd from one TreeView node to another TreeView_CS

VB: Add RecordFilterd from one TreeView node to another TreeView_VB

Reference link: https://help.syncfusion.com/windowsforms/classic/gridgroupingcontrol/filtering

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon