Parent Collapse Children when filtered

Hi, I am using a GGC with a dataview as a datasource for it. When I filter the parent values with a child row expanded, the parent row collapses. I need to be able to filter parents while keeping the child rows visible. IS this possible? I have included a code snippet of how I am trying to achive the filter. Form1.GridGroupingControl1.BeginUpdate() Dim MyGridDV As DataView Dim DV As New DataView Dim MyDS As New DataSet MyGridDV = Form1.GridGroupingControl1.DataSource MyDS = MyGridDV.DataViewManager.DataSet DV = MyDS.Tables(0).DefaultView DV.RowFilter = ("Digital_data_exist =''1''") ''Form1.GridGroupingControl1.DataSource = MyGridDV Form1.GridGroupingControl1.EndUpdate(True) Regards, Chris Wescott

3 Replies

AD Administrator Syncfusion Team April 5, 2006 05:49 AM UTC

Hi Chris, The records in a parent table can be filtered with the help of the TableDescriptor.RecordFilters with out the child table getting collapsed. Below is a code snippet. Let us know if this serves your need. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.GridGroupingControl1.TableDescriptor.RecordFilters.Add("[Digital_data_exist] = ''1''") End Sub Regards, Calvin.


CW Chris Wescott April 7, 2006 07:36 PM UTC

This is Great, If I wanted to implement this type of a record filter on my nested table. I tried something like this but it didn''t work. Dim TbDsc As New GridTableDescriptor TbDsc = GridGroupingControl1.TableDescriptor.Relations(0).ChildTableDescriptor tbdsc.TableDescriptor.RecordFilters.Add("[My_Row_Type] = ''MP''") Is there a different way I should be implementing this. Regards, Chris


AD Administrator Syncfusion Team April 10, 2006 05:06 AM UTC

Hi Chris, Below is a code snippet that filters record from both parent and child table. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim parentTableDescriptor As GridTableDescriptor = Me.GridGroupingControl1.GetTable(parentTableName).TableDescriptor parentTableDescriptor.RecordFilters.Add("[SomethingEXIST] = ''1''") Dim childTableDescriptor As GridTableDescriptor = Me.GridGroupingControl1.GetTable(childTableName).TableDescriptor childTableDescriptor.RecordFilters.Add("[SomethingEXIST] = ''1''") Me.GridGroupingControl1.Table.InvalidateCounterTopDown(True) End Sub Regards, Calvin.

Loader.
Up arrow icon