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. Image for the cookie policy date

How to get all tables name in ggc

Hello,

1. I need to enumerate all table name in GridGroupingControl, how to get it all?

I can get only childtables with this code, but can't get it through grandchilds, etc.
'For Each table As GridTable In ggc.Table.RelatedTables'

2. I can only enable filter in parenttable with this code:
For Each gcd As GridColumnDescriptor In ggc.TableDescriptor.Columns
gcd.AllowFilter = True
Next

How to add filters in childtables and grandchilds ?

Thanks for your assist.
Harry


1 Reply

AD Administrator Syncfusion Team February 18, 2008 11:54 AM UTC

Hi Harry,

Thank you for your interest in Syncfusion Products.

1) Currently it is not possible to retrieve the Grand Child table names using ggc.Table.RelatedTables. As a work around, please find the following code snippet that retrieves the child table and grand child table name.

Dim engine As GridEngine = gridGroupingControl1.Engine
Dim parentTableDescriptor As GridTableDescriptor = CType(engine.TableDescriptor, GridTableDescriptor)
Dim index As Integer = 0
Do While index < parentTableDescriptor.Relations.Count
Dim str As String = parentTableDescriptor.Relations(index).Name
Dim t As TableDescriptor = Me.gridGroupingControl1.GetTableDescriptor(str)
Dim i As Integer = 0
Do While i < t.Relations.Count
Console.WriteLine(t.Relations(i).Name)
i += 1
Loop
index += 1
Loop

2) To set filter for Child and Grand Child Table:

To have filters in nested tables and in child tables, we need to set NestedTableGroupOptions.ShowFilterBar property to true. The following code snippet sets filterbar for parent, child and grand child.

Me.gridGroupingControl1.NestedTableGroupOptions.ShowFilterBar = True
Dim engine As GridEngine = Me.gridGroupingControl1.Engine
Dim parentTableDescriptor As GridTableDescriptor = CType(engine.TableDescriptor, GridTableDescriptor)
parentTableDescriptor.Columns(0).AllowFilter = True
Dim parentToChildRelationDescriptor As RelationDescriptor = parentTableDescriptor.Relations("ChildTable")
Dim childTableDescriptor As GridTableDescriptor = CType(parentToChildRelationDescriptor.ChildTableDescriptor, GridTableDescriptor)
childTableDescriptor.Columns(0).AllowFilter = True
Dim childToGrandChildRelationDescriptor As RelationDescriptor = childTableDescriptor.Relations("GrandChildTable")
Dim grandChildTableDescriptor As GridTableDescriptor = CType(childToGrandChildRelationDescriptor.ChildTableDescriptor, GridTableDescriptor)
grandChildTableDescriptor.Columns(0).AllowFilter = True

Please let me know if any concerns.

Regards,
Fathima



Loader.
Live Chat Icon For mobile
Up arrow icon