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. Image for the cookie policy date

Transparent color throws an exception

I am using the dropdowngrid sample in v3.0.1. Changing the cell to transparent color throws an exception. Is there any workaround for this problem?

6 Replies

AD Administrator Syncfusion Team February 3, 2006 12:18 PM UTC

Hi Patrick, Here is the work around. To have the transparent color in the ColorEdit celltype, you have to use the custom celltype. This celltype as to be derived from the DropDownCellModel and DropDownCellRenderer. The DropDownCellModel class handles the serialization requirements for the control and creates the renderer class and the DropDownCellRenderer class handles the UI requirements of the cell. Kindly refer to the sample for more details. Let us know if you need further assistance, Regards, Madhan


AD Administrator Syncfusion Team February 6, 2006 07:25 PM UTC

Thank you very much. -patrick


JY Jeong-Seok Yang August 8, 2006 07:27 AM UTC

There is a bug in Sample provided at 2/3/2006 7:18:45 AM

I changed the Form1_Load like the below.
a few cells bacome to select color.
But If I click the colum select, all cells are
changed to a one last color.

How can I solve it!


private void Form1_Load(object sender, System.EventArgs e)
{
this.gridControl1.CellModels.Add("Color", new GridDropDownColorUICellModel1(this.gridControl1.Model));
this.gridControl1[3,3].CellType = "Color";
this.gridControl1[4,3].CellType = "Color";
this.gridControl1[5,3].CellType = "Color";
this.gridControl1[2,3].CellType = "Color";
this.gridControl1.DefaultColWidth = 80;
}


AD Administrator Syncfusion Team August 8, 2006 10:37 AM UTC

Hi,

In the sample, please make the following changes to the OnPrepareViewStyleInfo override.

public override void OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e)
{
if(e.Style.Text.Length > 0)
{
Color color = ColorConvert.ColorFromString(e.Style.Text);
e.Style.Interior = new BrushInfo(color);
}
}

Let us know if you need any further assistance.
Regards,
Rajagopal


JY Jeong-Seok Yang August 8, 2006 03:11 PM UTC

even After Adding the codes,
still the problem exists.

After selecting one color by clicking the button,
Only clicking the new cell changes the cell color to the last clicked color.


ColorEdit_Transparent(2).zip


AD Administrator Syncfusion Team August 9, 2006 09:09 AM UTC

Hi,

Please try calling the CurrentCell.EndEdit() method in the ChildClosing override to resolve this problem. Kindly refer to the attached sample that works fine with some small changes.
Here is the sample
ColorEdit_Sample.zip

Thanks for using Syncfusion Products.
Regards,
Rajagopal


Loader.
Live Chat Icon For mobile
Up arrow icon