I've made a client application in Windows Forms. I've used Windows Server 2008 R2 for development.
However client has reported few bugs which I am not able to reproduce on my machine but when I deploy same solution on Windows 7 or 10. It gives me different results.
As of now I now two problems:
DataGridViewComboBoxColumn
backcolour turns out to be gray.I've created a test application with minimal code and found that this problem persists with test app as well.
DataGridViewComboBoxColumn column = new DataGridViewComboBoxColumn();
{
column.HeaderText = "CB";
column.Name = "CB";
column.DefaultCellStyle.BackColor = Color.White;
//column.CellTemplate = new DataGridViewCheckBoxCell();
column.DataSource = list;
column.ValueType = typeof(string);
}
dataGridView1.Columns.Add(column);
dataGridView1.DataSource = dtEmp;
Here is screenshot of problem:
Windows 10 - Notice that despite moving cursor key, first column is not highlighted
Windows 2008- Notice that dfirst column is highlighted and cells are not grayed out.
Any help would be greatly appreciated.
You might try to change DisplayStyle property to Nothing
enum value so that your column will by styled and focus will be visible. However combobox arrow obviously disappears, but that might not be an issue for you.
this.Column1.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing;
Or try to change FlatStyle property to Flat
so that you will see a combo box arrow:
this.Column1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;