private void studentGridView_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0) { DataGridViewRow row = studentGridView.Rows[e.RowIndex]; grNo = Convert.ToInt32((row.Cells["GRNo"].Value.ToString())); EditStudent es = new EditStudent(grNo); es.Show(); } }
private void Edit_Click(object sender, EventArgs e) { if (grNo > 0) { EditStudent es = new EditStudent(grNo); es.Show(); } else { MessageBox.Show("Select Row which you Delete"); } }