GridGrouping Control and Primary Key Column

Hi,

For a GridGrouping Control, to bind the data to the control, I have to specify the Primary Key otherwise the data doesn't get binded to the GGC.

GridGroupControl1.TableDescriptor.PrimaryKeyColumns.Add("Field1");

In my application, the tablename is constructed in the code, so I don't know what is the field names to specify as the PrimaryKey Column.

Is there a way to specify the column number rather than the name of the table column as the Primary Key Column for the GGC?

If not, what alternatives do I have?

Thanks,

Monica

2 Replies

GB Gokul B Syncfusion Team March 9, 2007 01:38 AM UTC

Hi Monica,

You can specify the column number rather than the name of the column name as the PrimaryKey using below code snippet.

//Gets the Name of the column from the specific Index
String str = this.GridGroupingControl1.TableDescriptor.Columns[0].Name;
this.GridGroupingControl1.TableDescriptor.PrimaryKeyColumns.Add(str);

Let us know if you have any other queries.

Thanks for using Syncfusion products.

Regards,
Gokulkumar.B


AD Administrator Syncfusion Team March 9, 2007 03:01 PM UTC

Hi Gokulkumar,

Thank you!!

Loader.
Up arrow icon