How to deselect all selected rows in a DataGridView control?

前端 未结 6 714
臣服心动
臣服心动 2021-01-31 01:24

I\'d like to deselect all selected rows in a DataGridView control when the user clicks on a blank (non-row) part of the control.
How can I do this?

6条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 02:30

    i found out why my first row was default selected and found out how to not select it by default.

    By default my datagridview was the object with the first tab-stop on my windows form. Making the tab stop first on another object (maybe disabling tabstop for the datagrid at all will work to) disabled selecting the first row

提交回复
热议问题