在SelectedIndexChanging事件中,把该行的主键取出来,然后window.open()新页面,参数传过去接下来就好做了吧,更新完毕关闭新开的窗口并刷新原来网页

解决方案 »

  1.   

    /// <summary>
    /// 双击dataGridView弹出添加,删除
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
    {
        dataGridView1.Rows[e.RowIndex].Selected = true;
        if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "")
        {
            AddStorage add = new AddStorage();
            add.Show();
        }
        else
        {
            UpdateStorage update = new UpdateStorage();
            update.count = int.Parse(dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString());
            update.Show();
        }
    }