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
close icon

GridGroupingControl: how to get column collection

Hi,

How to get column collection in GridGroupingControl. Like in DataGridBound

GridBoundColumnsCollection col = GridBoundColumns;

Regards
Vivek

4 Replies

AD Administrator Syncfusion Team December 22, 2006 10:51 AM UTC

Hi Vivek,

Use the TableDescriptor.Columns property to get column collection in a GridGroupingGrid. Here is a code snippet.

GridColumnDescriptorCollection columns = this.gridGroupingControl1.TableDescriptor.Columns;

Best Regards,
Haneef


UB UBS December 22, 2006 11:17 AM UTC

Hi,
wht is the replacment of this code Binder.InternalColumns; for GridGroupingControl

Regards
Vivek

>Hi Vivek,

Use the TableDescriptor.Columns property to get column collection in a GridGroupingGrid. Here is a code snippet.

GridColumnDescriptorCollection columns = this.gridGroupingControl1.TableDescriptor.Columns;

Best Regards,
Haneef


UB UBS December 22, 2006 11:58 AM UTC

Hi,

Actually I have to achieve this functionality into GridGroupingControl, below mentioned code is for GridDataBoundGrid

GridBoundColumnsCollection col = GridBoundColumns;

if (col.Count == 0)
col = Binder.InternalColumns;

Regards
Vivek


AD Administrator Syncfusion Team December 26, 2006 11:00 AM UTC

Hi Vivek,

For the GridGroupingGrid, there are two different ways to get the column collection in a Grid. One for managing the visible columns in a grid. Another one for managing the bounded columns in a grid. Here is a code snippet

GridColumnDescriptorCollection columns = this.grid.TableDescriptor.Columns;

GridVisibleColumnDescriptorCollection columns = this.grid.TableDescriptor.VisibleColumns;

>>>> GridBoundColumnsCollection col = GridBoundColumns;
>>>>
>>>> if (col.Count == 0)
>>>> col = Binder.InternalColumns;

In the above code snippet, the Binder.InternalColumns and GridBoundColumns specify bounded columns in a GridDataBoundGrid. You can use the TableDescriptor.Columns to access the bounded column in a groupinggrid.

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon