马上给分,我在DataTable添加一新行,DataGridView如何马上定位到当前添加的新行上!

解决方案 »

  1.   

    // 把选中的行移动到用户新增的那行(最后一笔)
                DataGridView.CurrentCell = DataGridView.Rows[this.DataGridView.Rows.Count - 1].Cells[0];
      

  2.   

    DataGridViewCell cell = this.dataGridView1[0,1];
    this.dataGridView1.CurrentCell = cell;定位到第二行
    不过要事前判断行数,不然出错
      

  3.   

    DataGridView.CurrentCell = DataGridView.Rows[你要的行索引].Cells[0];