private void dgDeliveryGrid_SelectionChanged_1(object sender, EventArgs e) { if (dgDeliveryGrid.DataSource != null) { BindingManagerBase bm = BindingContext[dgDeliveryGrid.DataSource, dgDeliveryGrid.DataMember]; if (bm.Count > 0 && bm.Current != null) { int k = ((DeliveryDto)bm.Current).DeliveryID; _selectedDelivery = _deliveryService.FindDelivery(k); bsSelectedDelivery.DataSource = _selectedDelivery; if (OnDeliverySelected != null) { OnDeliverySelected(this, new DeliverySelectedEventArgs { selectedDelivery = _selectedDelivery }); } } } }
private void Ctl_OnDeliverySelected(object sender, DeliveriesListControl.DeliverySelectedEventArgs e) { var result = deliveryService.FindDelivery(e.selectedDelivery.DeliveryID); manager.SetActiveDelivery(result); }