111,120
社区成员
发帖
与我相关
我的任务
分享
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
if (dataGridView1.CurrentCell != null)
{
//第三行第三列
if (dataGridView1.CurrentCell.RowIndex == 2 && dataGridView1.CurrentCell.ColumnIndex == 2)
{
dataGridView1.CurrentCell= dataGridView1.Rows[1].Cells[1];//设置第二行行二列
}
}
}
在SelectionChanged事件里就可以了。