DataGridView without selected row at the beginning

后端 未结 12 1035
栀梦
栀梦 2021-02-12 14:23

In my WinForms I have DataGridView. I wanted to select full row at once so I set SelectionMode as FullRowSelect. And now I have problem, b

12条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-12 14:36

    Unfortunately none of these answers helped me, but I found other solution. Instead of unable selection I will just hide it with this piece of code:

    dataGridView1.DefaultCellStyle.SelectionBackColor = dataGridView1.DefaultCellStyle.BackColor;
    dataGridView1.DefaultCellStyle.SelectionForeColor = dataGridView1.DefaultCellStyle.ForeColor;
    

    So if anyone just wants to hide the selection it's gonna work pretty well.

    Cheers :)

提交回复
热议问题