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

ComboBox question

Hi, I was wondering if anyone has come across a way to change the background color of a combobox cell but not the button color. I am setting my cells background color to black but then the combobox button also changes to black. Any suggestions would be appreciated Thanks Nicola White

7 Replies

AD Administrator Syncfusion Team July 9, 2004 12:30 PM UTC

I do not see this behavior. Dropping a gridcontrol on a form and adding this form load, the combo button still shows gray for me. private void Form2_Load(object sender, System.EventArgs e) { this.gridControl1[2,2].CellType = "ComboBox"; this.gridControl1[2,2].BackColor = Color.Black; } Are you doing something different? Can you post a sample or show code where you are setting up the cell?


NI Nicola July 9, 2004 12:43 PM UTC

I am setting the background color in the PrepareViewStyleInfo function. Could this be causing my problem?


AD Administrator Syncfusion Team July 9, 2004 12:55 PM UTC

I added a PrepareViewStyleInfo event handler and set the e.Style.BackColor there when the cell was 2,2 and still could not see the problem. Do you really see a black button, or is the button missing (and this is reason the whole cell is black). If it is the latter, you might make sure you are setting e.Style.CellType = "ComboBox" in this case.


NI Nicola July 9, 2004 12:59 PM UTC

I really see a black button. I can click on it and my dropdown list appears.


AD Administrator Syncfusion Team July 9, 2004 01:29 PM UTC

Can you reproduce this in any of our samples, say the grid\samples\CellTypes\ComboBoxes? Or can you post a sample showing the problem?


AD Administrator Syncfusion Team July 9, 2004 01:32 PM UTC

Also, do you have XP-Themes enabled?


NI Nicola July 9, 2004 06:07 PM UTC

I figured out what I was doing wrong. I had intercepted the DrawCellButtonBackground event. And didn''t realize this is what was causing the problem. Thanks for all your help!

Loader.
Live Chat Icon For mobile
Up arrow icon