Selecting a row in DataGridView programmatically

后端 未结 8 2380
被撕碎了的回忆
被撕碎了的回忆 2020-12-08 12:58

How can I select a particular range of rows in a DataGridView programmatically at runtime?

8条回答
  •  青春惊慌失措
    2020-12-08 13:07

    DataGridView.Rows
        .OfType()
         .Where(x => (int)x.Cells["Id"].Value == pId)
         .ToArray()[0]
         .Selected = true;
    

提交回复
热议问题