The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
STstanleyj 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
HZHui ZhongJanuary 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
ADAdministrator 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