DataGridView - Focus a specific cell

后端 未结 10 1450
陌清茗
陌清茗 2020-12-03 00:54

How to set focus on any specified cell in DataGridView? I was expecting a simple way like Focus(rowindex,columnindex) but it is not that easy.

10条回答
  •  一个人的身影
    2020-12-03 01:06

    in event form_load (object sender, EventArgs e) try this

    dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count1].Cells[0];

    this code make focus on last row and 1st cell

提交回复
热议问题