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

format column in ggc to display color

Thread ID:

Created:

Updated:

Platform:

Replies:

69553 Nov 1,2007 11:28 AM UTC Nov 1,2007 02:42 PM UTC WinForms 1
loading
Tags: GridControl
prabhjeet
Asked On November 1, 2007 11:28 AM UTC

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

haneefm [Syncfusion]
Replied On 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

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

;