Conditional formatting of columns

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
2 Replies

AD Administrator Syncfusion Team 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

VS Vijay Sagar 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.

Loader.
Up arrow icon