private void btChange_Click(object sender, EventArgs e) { if (DataGridAuditor.SelectedRows.Count == 1) { DataRow Row = ((DataRowView)DataGridAuditor.SelectedRows[0].DataBoundItem).Row; MAuditor mAuditor = new MAuditor((string)Row["NameOfAuditor"], (string)Row["Cafedra"], (ushort)Row["Spacious"], (byte)Row["Building"]); AddAuditor add = new AddAuditor(mAuditor); add.Owner = this; add.ShowDialog(); } else { MessageBox.Show("Для изменения выделите только одну строку!"); } }
private void btAddAuditor_Click(object sender, EventArgs e) { AddAuditor a = new AddAuditor(); a.ShowDialog(); }