private void toolStripButton2_Click(object sender, EventArgs e) //修改 { colCount = gridView1.Columns.Count() - 1; array = new string[colCount]; for (int i = 0; i < colCount; i++) { array[i] = gridView1.GetFocusedRowCellDisplayText(gridView1.Columns[i]); } if (array[0].Length > 0) { try { isExist = true; New_GoDownEntry gde = new New_GoDownEntry(); gde.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("该条数据不含主键,无法修改"); } }
private void toolStripButton1_Click(object sender, EventArgs e) //保存 { isExist = false; New_GoDownEntry gde = new New_GoDownEntry(); gde.ShowDialog(); }