private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { if (e.RowIndex > dataGridView1.RowCount - 1) { return; } //get the real index. int realIndex = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value); CustVenView cvv = new CustVenView(custVenInfoList[realIndex]); if (DialogResult.Yes == cvv.ShowDialog()) { tsbRefresh_Click(this, null); } RestoreSelectedRow(); } }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if(e.RowIndex>=0&&e.ColumnIndex>=0) { if(e.RowIndex>dataGridView1.RowCount-1) return; //get the real index. int realIndex = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value); CustVenView cvv = new CustVenView(custVenInfoList[realIndex]); if (DialogResult.Yes == cvv.ShowDialog()) { tsbRefresh_Click(this, null); } RestoreSelectedRow(); } }