void EditSelectedRow() { var selectedRow = dgvList.SelectedRows[0]; var selectedSplit = (AutoSplit)selectedRow.DataBoundItem; EditedList[selectedRow.Index] = AutoSplitEditor.ShowEditor(_env, selectedSplit); DgvList_ResetBindings(selectedRow.Index); }
public static AutoSplit ShowEditor(AutoSplitEnv env, AutoSplit source = null) { using (var form = new AutoSplitEditor(env, source)) { return(form.ShowDialog() != DialogResult.Cancel ? form.EditedAutoSplit : source); } }
void btnCreate_Click(object sender, EventArgs e) { var newSplit = AutoSplitEditor.ShowEditor(_env); if (newSplit != null) { var list = (BindingList <AutoSplit>)dgvList.DataSource; list.Add(newSplit); } }