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.

Conditional formatting of columns

Thread ID:

Created:

Updated:

Platform:

Replies:

42782 Apr 5,2006 04:26 PM Apr 7,2006 07:55 AM Windows Forms 2
loading
Tags: GridControl
Vijay Sagar
Asked On April 5, 2006 04:26 PM

I am trying to set the color of a column in the grouping grid based on the header text for that column. I loop through all the columns in the grid as follows and I use ColStyles[a] to set the color based on the header as below. However, the color is not getting set after the loop is over. for (int a =0; a

Administrator [Syncfusion]
Replied On April 6, 2006 03:31 AM

Hi Vijay, Please try the below code to set the color of a column in the GroupingGridControl based on the header text. for (int a =0; a

Vijay Sagar
Replied On April 7, 2006 07:55 AM

Thanks. It works. >Hi Vijay, > >Please try the below code to set the color of a column in the GroupingGridControl based on the header text. > >for (int a =0; a{ > >if (this.gdcMetaData.TableDescriptor.Columns[a].HeaderText.StartsWith("Full Mapping")) >this.gdcMetaData.TableDescriptor.Columns[a].Appearance.AnyRecordFieldCell.BackColor = Color.LightGoldenrodYellow; >else if (this.gdcMetaData.TableDescriptor.Columns[a].HeaderText.StartsWith("Source Mapping")) >this.gdcMetaData.TableDescriptor.Columns[a].Appearance.AnyRecordFieldCell.BackColor = Color.LightSeaGreen; >else if (this.gdcMetaData.TableDescriptor.Columns[a].HeaderText.StartsWith("Complex Mapping")) >this.gdcMetaData.TableModel.ColStyles[a].BackColor = Color.LightPink; >else if (this.gdcMetaData.TableDescriptor.Columns[a].HeaderText.StartsWith("Source Mapping")) >this.gdcMetaData.TableDescriptor.Columns[a].Appearance.AnyRecordFieldCell.BackColor = Color.LightSkyBlue; >} > >Regards, >Calvin.

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.

;