format column in ggc to display color

I am using syncfusion ggc, in one of my columns i have to display color..but when i pass color to diplay it displays color number in that column instead of color.
i will be v helpful if anyone could tell me how to diplay color instead of the number

1 Reply

HA haneefm Syncfusion Team November 1, 2007 02:42 PM UTC

Hi Prabjitbehl,

To display the color insted of number in a gridcell, you need to set the CellType of the column's appearance object to "ColorEdit".Setting this celltype display the DropDownButton in a gridcell to select color at runtime. If you want to hide the DropDownButton then you can also set the ShowButtons property to GridShowButtons.Hide. Below are the codes that shows this task.

this.gridGroupingControl1.TableDescriptor.Columns["ColorColName"].Appearance.AnyRecordFieldCell.CellType = "ColorEdit";
this.gridGroupingControl1.TableDescriptor.Columns["ColorColName"].Appearance.AnyRecordFieldCell.ShowButtons = GridShowButtons.Hide;

You can set the cellvalue of ColorEdit cell by using the below code:

foreach (Record rec in this.gridGroupingControl1.Table.Records)
{
rec.SetValue("ColorColName", Color.RoyalBlue);
}

Here is a sample for your reference.
GGCColorEditCell.zip

Best regards,
Haneef

Loader.
Up arrow icon