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, you need to add the same filter condition to each grid in the tree view node in the WinForms GridGroupingControl.
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);
}
}
}'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
'To avoid the repeated objects from the list
If grid.TableDescriptor.RecordFilters.Contains(filter) Then
Continue For
End If
grid.TableDescriptor.RecordFilters.Add(filter)
Next filter
Next grid
End SubSamples:
C#: Filtering_CS
VB: Filtering_VB
Reference Link: Filtering
Conclusion
I hope you enjoyed learning how to add filters from one TreeView node to another TreeView node in GridGroupingControl.
Refer to our WinForms GridGroupingControl feature tour page for its other groundbreaking feature representations. You can also explore our WinForms GridGroupingControl 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!