private void AddToEditButton_Click(object sender, EventArgs e) { OneItemEditForm editForm = new OneItemEditForm(); if (editForm.ShowDialog() == DialogResult.OK) { newEdit.AddWithID((Item)editForm.ReturnedItem); RefreshMainEditDataView(newEdit); MainEditDataView["QChange", MainEditDataView.RowCount - 1].ReadOnly = true; } }
//Редактирование одного элемента private void EditOnceButton_Click(object sender, EventArgs e) { OneItemEditForm dialog = new OneItemEditForm(); try { dialog.GetSelectedFromFatherForm(MainEditDataView); } catch (NoNullAllowedException) { return; } if (dialog.ShowDialog() == DialogResult.OK) { int?tmp = ((Item)MainEditDataView.CurrentRow.DataBoundItem).ID; ((Item)dialog.ReturnedItem).ID = tmp; newEdit.AddWithID((Item)dialog.ReturnedItem, true); } }