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

GridStyleInfo and GridgroupingControl

Hi
How can i get the GridStyleInfo for a column in a gridgrouping control?

in a DataBoundGrid i use:
Dim style As GridStyleInfo = Me.GridDataBoundGrid1.GridBoundColumns(XXX).StyleInfo

Thanks

3 Replies

AD Administrator Syncfusion Team November 3, 2006 10:38 AM UTC

Hi Stelios,

The attached sample demonstrates the formatting on columns. This can be achieved by defining a GridColumnDescriptor. It provides the mapping information to a column of the underlying datasource. You can associate this descriptor with a particular column by initializing its mapping name to the required column name. Once this is done, then the descriptor can be used to set the style settings for the specified column. Here is a sample code snippet.

GridColumnDescriptor column = this.gridGroupingControl1.TableDescriptor.Columns[1];
//For all cell in a column.
column.Appearance.AnyCell.BackColor = Color.Red;
//For header cell in a column...
column.Appearance.AnyHeaderCell.Themed = false;
column.Appearance.AnyHeaderCell.BackColor = Color.Green;
//For all alternate records cell in a column.
column.Appearance.AlternateRecordFieldCell.BackColor = Color.Blue;
//For all records cell in a column.
column.Appearance.RecordFieldCell.BackColor = Color.Yellow;

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GroupingStyles_5acc96a0.zip

Best Regards,
Haneef


AD Administrator Syncfusion Team November 3, 2006 11:49 AM UTC

Hi Haneef

Thanks for your reply.
It works using GridColumnDescriptor.

I was trying to set a custom cell type for a column.
Could you please help me understand what is the difference between :
Me.GridGroupingControl1.TableDescriptor.Columns(1).Appearance.AnyCell = "mytype"

and

Me.GridGroupingControl1.TableModel.ColStyles(1).CellType = "mytype"

Thanks
Stelios


AD Administrator Syncfusion Team November 6, 2006 11:31 AM UTC

Hi Stelios,

Me.GridGroupingControl1.TableModel.ColStyles(1).CellType = "mytype"

The above code doesn't work for the gridgrouping control. The reason is that the code is non-functional as they are not applied exactly to control these properties of the GridGroupingControl. You can get the desired style using the following code snippet.

Me.GridGroupingControl1.TableDescriptor.Columns(1).Appearance.AnyRecordFieldCell.CellType = "mytype"

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon