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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ComboBox question

Thread ID:





16260 Jul 9,2004 11:52 AM UTC Jul 9,2004 06:07 PM UTC WinForms 7
Tags: GridControl
Asked On July 9, 2004 11:52 AM UTC

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

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

Replied On July 9, 2004 12:43 PM UTC

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

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

Replied On July 9, 2004 12:59 PM UTC

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

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

Administrator [Syncfusion]
Replied On July 9, 2004 01:32 PM UTC

Also, do you have XP-Themes enabled?

Replied On 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!


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

Live Chat Icon For mobile
Live Chat Icon