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

ColorEdit and Transparent color

Thread ID:





30740 Jun 22,2005 11:56 PM UTC Jun 23,2005 12:59 AM UTC WinForms 1
Tags: GridControl
Sue Harris
Asked On June 22, 2005 11:56 PM UTC

Hi, I''ve got a grid with a ColorEdit cell. If the user selects the Transparent colour from the ColorEdit it throws an "This control does not support transparent background colors." exception. Is there a way to either (a) allow the ColorEdit to select Transparent (preferable); or (b) remove invalid colours from the ColorEdit colour list? You can duplicate this problem by running the CellStyles sample, changing a cell to ColorEdit cell type, then in the cell selecting Transparent. Thanks, Sue

Administrator [Syncfusion]
Replied On June 23, 2005 12:59 AM UTC

The reason this is happening is the the control in the cell is derived from TextBoxBase, and this WindowsForms control does not accept Transparent colors with its default settings. You can try directly calling Control.SetStyles through reflection to change this setting. (This method is protected, so you cannot directly call it.
GridDropDownColorUICellRenderer cr = this.gridControl1.CellRenderers["ColorEdit"] as GridDropDownColorUICellRenderer;
TextBoxBase ui = cr.TextBox;
System.Reflection.MethodInfo mInfo = typeof(Control).GetMethod("SetStyle", 
	System.Reflection.BindingFlags.Instance | 
	System.Reflection.BindingFlags.InvokeMethod | 
if(mInfo != null)
	mInfo.Invoke(ui, new object[]{ControlStyles.SupportsTransparentBackColor, true});


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

This page will automatically be redirected to the 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