void BtnEditModificationRow_Click(object sender, RoutedEventArgs e) { Modification modification = dgvModification.SelectedItem as Modification; if (modification == null) { return; } ModificationSaveWindow window = new ModificationSaveWindow(null, modification); window.ShowDialog(); }
void BtnAddModification_Click(object sender, RoutedEventArgs e) { Equipment equipment = dgvEquipment.SelectedItem as Equipment; if (equipment == null) { MessageBox.Show("Выберите оборудование!"); return; } ModificationSaveWindow window = new ModificationSaveWindow(equipment); window.ShowDialog(); SetModificationSource(); }
//Дабл клик по строке таблицы - открывает окно редактирования private void ModificationRowDoubleClick(object sender, MouseButtonEventArgs e) { DataGridRow row = sender as DataGridRow; Modification modification = row.Item as Modification; if (modification == null) { return; } ModificationSaveWindow window = new ModificationSaveWindow(null, modification); window.ShowDialog(); modificationViewSource.View.Refresh(); dgvModification.CurrentCell = new DataGridCellInfo(row.Item, dgvModification.CurrentCell.Column); }