diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index 8ead1cd2..d6066145 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -226,6 +226,7 @@ namespace ENI2 public void CoreChanged(MessageCore newCore) { this.Core = newCore; + this.ReloadCore(); System.Windows.Application.Current.Dispatcher.Invoke(delegate { if(controlCache.ContainsKey(Properties.Resources.textOverview)) diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index b9b4f2df..6a850f5f 100644 --- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -357,6 +357,9 @@ namespace ENI2.DetailViewControls this.buttonExcelImport.IsEnabled = !this.Core.DisplayId.IsNullOrEmpty(); + this.dataGridMessages.ItemsSource = null; + this.dataGridMessages.ItemsSource = this.Messages; + //MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId)); //ShowIdDialog sid = new ShowIdDialog(this.Core) //{ diff --git a/ENI2/SucheControl.xaml.cs b/ENI2/SucheControl.xaml.cs index 1d63af8f..e013710d 100644 --- a/ENI2/SucheControl.xaml.cs +++ b/ENI2/SucheControl.xaml.cs @@ -102,7 +102,8 @@ namespace ENI2 private void ContextMenu_ContextMenuOpening(object sender, ContextMenuEventArgs e) { MessageCore selectedCore = this.dataGrid.SelectedItem as MessageCore; - cancelItem.Visibility = (this.AdminMode && (selectedCore.Cancelled ?? false)) ? Visibility.Visible : Visibility.Collapsed; + if(selectedCore != null) + cancelItem.Visibility = (this.AdminMode && (selectedCore.Cancelled ?? false)) ? Visibility.Visible : Visibility.Collapsed; } private void CancelItem_Click(object sender, RoutedEventArgs e)