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.
Unfortunately, activation email could not send to your email. Please try again.

How to get all tables name in ggc

Thread ID:

Created:

Updated:

Platform:

Replies:

71859 Feb 17,2008 02:53 AM Feb 18,2008 06:54 AM Windows Forms 1
loading
Tags: GridControl
harisan
Asked On February 17, 2008 02:53 AM

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


Administrator [Syncfusion]
Replied On February 18, 2008 06:54 AM

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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;