Closed MagicAndre1981 closed 3 months ago
thanks for the report, i'll look into it.
hi, this should be fixed on v1.8.3 Thanks.
hi, this should be fixed on v1.8.3
no I still see it. I see you changed the code to if control again so this is the new version. Please add a version comment on top or create a nuget
the DataGridView on the Example Form shows the Blue highlight only on the selected Cell, please provide more details on how you implemented your Grid so i can replicate the issue.
I set the source and select a cell (Cell[0] is an ID from the database table which I hide):
dataGridView.AutoGenerateColumns = true;
dataGridView.DataSource = list;
if (dataGridView.Rows.Count > 0)
{
dataGridView.CurrentCell = dataGridView.Rows[0].Cells[1];
}
Using almost identical code: You can check the code here: https://github.com/BlueMystical/Dark-Mode-Forms/blob/f14d8e13a50c54a38a1e19eb3923b68105e5a667/Form1.cs#L64
How about the Grid's Selection Mode?
you set a dataGridViewCellStyle
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.Red;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
and assign this (dataGridView1.ColumnHeadersDefaultCellStyle
) what I don't do.
My SelectionMode
is System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
ColumnHeadersHeightSizeMode
is AutoSize
for my code and yours.
mmm... that was all autogenerated code from VS, i simply drop a Grid and leave all its props at their default. if i make to assign, intentionally this time, the ColumnHeadersDefaultCellStyle that will fix your issue? i mean it wont be a big deal for me to directly assign that.
if i make to assign, intentionally this time, the ColumnHeadersDefaultCellStyle that will fix your issue?
no, it is SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
Adding this to your sample also shows the blue background.
yeah, when the SelectionMode is FullRow, the headers get selected:
There is nothing on my code to make that to happen, its the Grids natural behaviour, but let me see what can i do to beautify it.
before 1.8.1 I didn't see this color. This is why I was confused.
once i understood the reason of the issue the fix was quite easy, its alive on v1.8.4
Thank you for reporting this and for your patience. Regards.
I've updated the source files to 1.8.1 and now I see this blue background for (only) the 1 column header and the selected row with
DataGridView
component: