int index = dataGridView1.SelectedRows[0].Index;
            new Form2().ShowDialog();
            dgvBind(dataGridView1);
            dataGridView1.ClearSelection();
            dataGridView1.Rows[index].Selected = true;

解决方案 »

  1.   

    在某一个类中就叫temp吧 其中放一个静态字段 tempIndex 
    当你双击时 就吧 index负给tempIndex 
    if(new Form2().ShowDialog()==DialogResult.Ok){
    dataGridView1.Rows[temp.tempIndex].Selected = true;
    }
    不知楼主明白否
      

  2.   

    也可以这样            int index = dataGridView1.CurrentRow.Index;
                new Form2().ShowDialog();
                dgvBind(dataGridView1);
                dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
                dataGridView1.CurrentCell = dataGridView1.Rows[index].Cells[0];
      

  3.   

    前面txt_ly()已经给出了两种方法,但是我还要补充的是。
    如果修改的字段正好是DataGridView所用排序的字段,修改后排序有所变化,依靠Index就不一定指向原来的纪录行了。
    所以最好记录关键字,依靠固定不变的关键字来定位行。