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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Conditional formatting of columns

Thread ID:

Created:

Updated:

Platform:

Replies:

42782 Apr 5,2006 08:26 PM UTC Apr 7,2006 11:55 AM UTC WinForms 2
loading
Tags: GridControl
Vijay Sagar
Asked On April 5, 2006 08:26 PM UTC

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 07:31 AM UTC

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 11:55 AM UTC

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.

Warning Icon 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.Close Icon

;