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

How to hide the text for ColorEdit type?

Thread ID:





117279 Sep 22,2014 08:54 PM UTC Sep 30,2014 05:21 AM UTC WinForms 3
Tags: GridControl
Tuan Lam
Asked On September 22, 2014 08:54 PM UTC

When setting a CellType to GridCellTypeName.ColorEdit, our users can see the color name (ie. Silver) or the color number (ie. 72, 179, 187) on the field when they click on the cell and drag.
Is there a way to disallow selection on a column or setting the selection background and foreground color so the user cannot see those information?

Attachment: ColorEdit_e7951420.zip

Solai A L [Syncfusion]
Replied On September 26, 2014 09:42 AM UTC

Hi Tuan,

Thank you for your interest in Syncfusion products.


To achieve your requirement use the event CurrentCellCloseDropDown and set the backcolor to forecolor. Please refer the below code snippet for further clarification and let us know if you have any concerns.


Code Snippet:


this.gridControl1.CurrentCellCloseDropDown += new PopupClosedEventHandler(gridControl1_CurrentCellCloseDropDown);


void gridControl1_CurrentCellCloseDropDown(object sender, PopupClosedEventArgs e)


            GridDropDownColorUICellRenderer rend = this.gridControl1.CurrentCell.Renderer as GridDropDownColorUICellRenderer;


            if (rend != null && !string.IsNullOrEmpty(rend.ControlText))


                this.gridControl1[rend.RowIndex, rend.ColIndex].TextColor = rend.StyleInfo.Interior.BackColor;



Thanks & Regards,


Tuan Lam
Replied On September 26, 2014 05:34 PM UTC

I tried the code you gave but it doesn't work.  The CurrentCellCloseDropDown doesn't even trigger yet since user can highlight the text inside of the cell before the dropdown is closed.
Please check out the original post's attachment for detail.  This issue is related to changing the selected text color (foreground and background).

Solai A L [Syncfusion]
Replied On September 30, 2014 05:21 AM UTC

Hi Tuan,

Thank you for your update.

Here with we have attached a sample implementing your requirement. Please refer this and still if you could not achieve your requirement then replicate your issue in this sample and send back to us. So, that it would be easy for us to provide a prompt solution.

Please let us know if you have any other concerns.

Thanks & Regards,


Attachment: WindowsFormsApplication5_e63b70c4.zip


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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