private void grdView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string[] arr = new string[7]; for (int i = 0; i < 7; i++) { arr[i] = grdView[i, grdView.SelectedCells[i].RowIndex].Value.ToString(); } SubAlter sub = new SubAlter(); sub.getStatus(1); sub.getArry(arr); sub.ShowDialog(); btnQuery_Click(null, null); }
private void btnAlt_Click(object sender, EventArgs e) { if (grdView.DataSource == null) { MessageBox.Show("请选中要修改的行!"); btnQuery_Click(null, null); } else { string[] arr = new string[7]; for (int i = 0; i < 7; i++) { arr[i] = grdView[i, grdView.SelectedCells[i].RowIndex].Value.ToString(); } SubAlter sub = new SubAlter(); sub.getStatus(1); sub.getArry(arr); sub.ShowDialog(); } btnQuery_Click(null, null); }