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