private void pesadomultiplebutton_Click(object sender, RoutedEventArgs e) { Editar_Bolsa Formeditarbolsa = new Editar_Bolsa(); try { listadetallegrilla = DetalleItemsdataGrid.ItemsSource.Cast <appWcfService.USP_OBTIENE_DETPREPARACION_POR_IDDETALLESE_Result>().ToList(); if (listadetallegrilla.Count >= 1) { Formeditarbolsa.listagrilla = listadetallegrilla; Formeditarbolsa.btnmulti = true; Formeditarbolsa.Owner = Window.GetWindow(this); Formeditarbolsa.ShowDialog(); } else { MessageBox.Show("Debe tener más de una bolsa registrada.", "Pesado Multiple", MessageBoxButton.OK, MessageBoxImage.Exclamation); } DetalleItemsdataGrid.UpdateLayout(); CollectionViewSource.GetDefaultView(DetalleItemsdataGrid.ItemsSource).Refresh(); cambio = true; totaliza(); } catch (Exception) { MessageBox.Show("Debe tener más de una bolsa registrada.", "Pesado Multiple", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
private void DetalleItemsdataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Editar_Bolsa Formeditarbolsa = new Editar_Bolsa(); bolsaseleccionada = DetalleItemsdataGrid.SelectedItem as appWcfService.USP_OBTIENE_DETPREPARACION_POR_IDDETALLESE_Result; if (bolsaseleccionada != null) { Formeditarbolsa.objbolsa = bolsaseleccionada; Formeditarbolsa.btnmulti = false; Formeditarbolsa.Owner = Window.GetWindow(this); Formeditarbolsa.ShowDialog(); } DetalleItemsdataGrid.UpdateLayout(); CollectionViewSource.GetDefaultView(DetalleItemsdataGrid.ItemsSource).Refresh(); cambio = true; totaliza(); //cantidadlabel.Content = bolsaseleccionada.BODPDIFE.ToString(); }