private void btnAdd_Click(object sender, EventArgs e) { AddFieldDialog dialog = new AddFieldDialog(); var result = dialog.ShowForm(null); if (result != DialogResult.Cancel) { refresh(); } }
private void btnEditSelected_Click(object sender, EventArgs e) { AddFieldDialog dialog = new AddFieldDialog(); DataGridViewRow row = null; if (dataGridFields.SelectedRows.Count > 0) { row = dataGridFields.SelectedRows[0]; FieldEntity doc = (FieldEntity)row.DataBoundItem; var result = dialog.ShowForm(doc); if (result != DialogResult.Cancel) { refresh(); } } else { MessageBox.Show("Please select a row to edit."); } }