How do I select a complete dataGridView Row when the user clicks a cell of that row?

后端 未结 6 996
梦毁少年i
梦毁少年i 2020-12-14 14:01

I have a dataGridView and I need that when the user clicks on any cell the whole row that contains this cell is selected too. (it has multiselect disbaled) I t

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 14:43

    You need to set datagridview's SelectionMode to FullRowMode.

    Note: In Visual Studio 2013 with .NET 4.5 the property is called FullRowSelect, see https://msdn.microsoft.com/en-us/library/3c89df86(v=vs.110).aspx

提交回复
热议问题