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
close icon

Combobox back color is changed when this cell is current cell

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.

3 Replies

ST stanleyj Syncfusion Team January 10, 2006 07:01 AM UTC

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


HZ Hui Zhong January 10, 2006 03:30 PM UTC

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


AD Administrator Syncfusion Team January 12, 2006 06:11 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon