How to set focus on a particular row in a datagrid/gridview?

前端 未结 6 1525
清酒与你
清酒与你 2021-01-04 18:07

I have a datagrid/gridview. I\'m populating the grid with 10 rows initially. On a button click every time,I\'m keeping on adding 10 rows to the datagrid/gridview. Now I want

6条回答
  •  被撕碎了的回忆
    2021-01-04 18:45

    Try this...

    DataGridViewRow rowToSelect = this.dgvJobList.CurrentRow;
    
    rowToSelect.Selected = true;
    
    
    
    rowToSelect.Cells[0].Selected = true;
    
    this.dgvJobList.CurrentCell = rowToSelect.Cells[0];
    
    this.dgvJobList.BeginEdit(true);
    

提交回复
热议问题