Welcome to the WPF feedback portal. We’re happy you’re here! If you have feedback on how to improve the WPF, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
I'm using datagrid in a page that resides in DockingManager as document.
In an earlier version 19.1.0.64, I did not have an issue but I experience a bug with version 19.2.60 and still occurs in version 19.4.0.38.
The code is complicated, not sure why it might happen, and it is hard to help you by providing more information. But I will try to explain the scenario when the exception happens.
Here is how I get the error. I open the document containing a grid, call it A, then switch to another tab, call it B. Once I switch back to document A, the app crashes with giving a object null reference error with call stack
Syncfusion.UI.Xaml.Grid.GridBaseSelectionController.DataGrid_Loaded(Object sender, RoutedEventArgs e)
I was using GridSelectionController and setting it once the data grid loads. As a patch I tried to set the SelectionController null when I navigate to the page right before the data grid loads. This patch did work and I got rid of the bug and the app did not crash.
But, overall the patch did not work because it results in new type of errors:
First error: once I start resizing the document A, (by for instance resizing the tab group containing A), I got another object null exceptions with call stack at
Syncfusion.UI.Xaml.Grid.RowGenerator.EnsureRows(Syncfusion.UI.Xaml.ScrollAxis.VisibleLinesCollection)
Second error: if I try to switch to another tab then again
Syncfusion.UI.Xaml.Grid.ValidationHelper.ResetValidation(Syncfusion.UI.Xaml.Grid.SfDataGrid, bool)
Syncfusion.UI.Xaml.Grid.SfDataGrid.OnUnloaded(object, System.Windows.RoutedEventArgs)
System.Windows.EventRoute.InvokeHandlersImpl(object, System.Windows.RoutedEventArgs, bool)
System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
System.Windows.BroadcastEventHelper.BroadcastEvent(System.Windows.DependencyObject, System.Windows.RoutedEvent)
System.Windows.BroadcastEventHelper.BroadcastUnloadedEvent(object)
MS.Internal.LoadedOrUnloadedOperation.DoWork()
System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
System.Windows.Media.MediaContext.RenderMessageHandlerCore(object)