How to add filters from one TreeView node to another TreeView node in WinForms GridGroupingControl?
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 in WinForms GridGrouping.
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
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
Conclusion
I hope you enjoyed learning how to add filters from one TreeView node to another TreeView node in WinForms GridGroupingControl.
Refer to our WinForms GridControl’s feature tour page for its other groundbreaking feature representations. You can also explore our WinForms GridControl documentation to understand how to present and manipulate data.
For current customers, check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our WinForms GridControl and other WinForms components.
Please let us know in the following comment section if you have any queries or require clarifications. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!