//Контекстное меню установки статуса "Отгружено" void ContextSetIsShipped_Click(object sender, RoutedEventArgs e) { Bid bid = dgvBid.SelectedItem as Bid; if (bid == null) { return; } BidShipmentSaveWindow window = new BidShipmentSaveWindow(bid); window.ShowDialog(); viewSource.View.Refresh(); }
//Клик по кнопке установки статуса 'отгружено', открывает окно установки статуса void BtnSetShipment_Click(object sender, RoutedEventArgs e) { Bid bid = dgvBid.SelectedItem as Bid; if (bid == null) { MessageBox.Show("Выберите заявку!"); return; } BidShipmentSaveWindow window = new BidShipmentSaveWindow(bid); window.ShowDialog(); viewSource.View.Refresh(); }
//Дабл клик по строке таблицы - открывает окно редактирования private void DgvBid_RowDoubleClick(object sender, MouseButtonEventArgs e) { DataGridRow row = sender as DataGridRow; Bid bid = row.Item as Bid; if (bid == null) { return; } BidShipmentSaveWindow window = new BidShipmentSaveWindow(bid); window.ShowDialog(); viewSource.View.Refresh(); dgvBid.CurrentCell = new DataGridCellInfo(row.Item, dgvBid.CurrentCell.Column); }