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

Combobox back color is changed when this cell is current cell

Thread ID:

Created:

Updated:

Platform:

Replies:

39469 Jan 9,2006 12:42 PM Jan 12,2006 01:11 PM Windows Forms 3
loading
Tags: GridControl
Hui Zhong
Asked On January 9, 2006 12:42 PM

I set the current cell color as yellow, however, when the current cell is a combobox type, the combobox is colored yellow. Is there anyway to prevent this combobox colored? (The MonthCalendar type doesn''t change the control color when it''s the current cell). Thanks.

stanleyj [Syncfusion]
Replied On January 10, 2006 02:01 AM

Hi Hui, I do not see any difference, however the yellow colored combo box when that has the current cell can be changed to any other colors. if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex)) { if (e.Style.CellType == "MonthCalendar") e.Style.BackColor = Color.Pink; else if (e.Style.CellType == "ComboBox") e.Style.BackColor = Color.Pink; else e.Style.Interior = new BrushInfo(Color.Yellow); } Let me know if this does not help. Best regards, Stanley

Hui Zhong
Replied On January 10, 2006 10:30 AM

Stanley: The e.Style.CellType is "ComboBox", I set the e.Style.ShowButtons = GridShowButtons.ShowCurrentCellEditing; so the combobox list is shown only when the cursor enter this cell for edit. The current cell backcolor is set yellow, when the cursor enter this cell, the cell backcolor is yellow, however, when the combobox is shown, the combobox is colored yellow also, which is not my expection. Hui >Hi Hui, > >I do not see any difference, however the yellow colored combo box when that has the current cell can be changed to any other colors. > > if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex)) > { > if (e.Style.CellType == "MonthCalendar") > e.Style.BackColor = Color.Pink; > else if (e.Style.CellType == "ComboBox") > e.Style.BackColor = Color.Pink; > else > e.Style.Interior = new BrushInfo(Color.Yellow); > } > >Let me know if this does not help. > >Best regards, >Stanley

Administrator [Syncfusion]
Replied On January 12, 2006 01:11 PM

Hi Hui, That can be handled in the ListBoxPart of the ComboBoxCellRenderer in the CurrentCellShowingDropDown event. private void gridControl1_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e) { GridComboBoxCellRenderer ren = (GridComboBoxCellRenderer)this.gridControl1.CurrentCell.Renderer; ren.ListBoxPart.BackColor = Color.White; } Best regards, Stanley

CONFIRMATION

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.

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.

;