Hi,
I have a form with one DataGridView, which fills up from the database when the form loads. Everything loads properly the first time. After I make changes, close the form and reopen it, the header cell of the second column turns dark blue, as if selected. Why does this happen? Please see image. I have set the following properties in the design:
ColumnHeaderDeaultCellStyle --> BackColor & SelectionBackColor = Color.Control
EnableHeaderVisualStyles --> True
Inside the gridview.Columns properties table:
DeafultCellStyle --> BackColor and SelectionBackColor --> Color.Control
Just to check, I wrote a message box code in the load form to check the backcolor properties of the errant column:
MessageBox.Show(dgvGrid.Columns(1).HeaderText & " : " & dgvGrid.Columns(1).HeaderCell.Style.BackColor.ToString & " " & dgvGrid.Columns(1).Selected.ToString)
This is what the message box shows: Condition: Color [Empty] False
Screenshot: