void BtnEditRow_Click(object sender, RoutedEventArgs e) { TransportCompany transportCompany = dgvTransportCompany.SelectedItem as TransportCompany; if (transportCompany == null) { return; } TransportCompanySaveWindow window = new TransportCompanySaveWindow(transportCompany); window.ShowDialog(); }
//Дабл клик по строке таблицы - открывает окно редактирования private void RowDoubleClick(object sender, MouseButtonEventArgs e) { DataGridRow row = sender as DataGridRow; TransportCompany transportCompany = row.Item as TransportCompany; if (transportCompany == null) { return; } TransportCompanySaveWindow window = new TransportCompanySaveWindow(transportCompany); window.ShowDialog(); viewSource.View.Refresh(); dgvTransportCompany.CurrentCell = new DataGridCellInfo(row.Item, dgvTransportCompany.CurrentCell.Column); }
void BtnAdd_Click(object sender, RoutedEventArgs e) { TransportCompanySaveWindow window = new TransportCompanySaveWindow(); window.ShowDialog(); }