This is a migrated thread and some comments may be shown as answers.

Basic sorting crashes

1 Answer 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Philipp
Top achievements
Rank 1
Philipp asked on 01 Feb 2017, 02:59 PM

Hi,

I have for example following GridView:

 

            <telerik:RadGridView x:Name="gvSystems" Grid.Row="1" Grid.Column="0" DataContext="{Binding}" ItemsSource="{Binding Systems}" AutoGenerateColumns="False"
                             ShowSearchPanel="False" ShowGroupPanel="False" ShowGroupFooters="False" IsFilteringAllowed="True" FilteringMode="FilterRow" IsReadOnly="True" GroupRenderMode="Flat"
                                 SelectionMode="{Binding QueryFilterModel.MultiSelectSystems, Converter={StaticResource BoolToSelectionModeConverter}}" Margin="3" CanUserSortColumns="True">          
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn IsSortable="True" Header="{Binding Path=[VXScada_GernericQueries_GridView_ID], Source={x:Static commonUIRes:TextContainer.Instance}}" DataMemberBinding="{Binding SystemID}" />
                    <telerik:GridViewDataColumn IsSortable="True" Header="{Binding Path=[VXScada_GernericQueries_GridView_Name], Source={x:Static commonUIRes:TextContainer.Instance}}" DataMemberBinding="{Binding SystemName}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>     

If I click into the header to sort my application crashes with following Exception (This happens with each RadGridView I have):

System.NullReferenceException

Source: Telerik.Windows.Data

StackTrace:

   bei Telerik.Windows.Data.QueryableCollectionView.InternalGetItemAt(Int32 index)
   bei Telerik.Windows.Data.QueryableCollectionView.GetItemAt(Int32 index)
   bei Telerik.Windows.Data.DataItemCollection.get_Item(Int32 index)
   bei Telerik.Windows.Controls.GridView.Rows.GetRowItemsAtRange(Int32 startIndex, Int32 endIndex)
   bei Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.RealizeRows(Int32 startIndex, Int32 endIndex, Double& verticalOffset, HashSet`1& realizedRows)
   bei Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.MeasureOverride(Size availableSize)
   bei Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
   bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   bei System.Windows.UIElement.Measure(Size availableSize)
   bei System.Windows.ContextLayoutManager.UpdateLayout()
   bei System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   bei System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   bei System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   bei System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
   bei MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   bei MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   bei System.Windows.Threading.DispatcherOperation.Invoke()
   bei System.Windows.Threading.Dispatcher.ProcessQueue()
   bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   bei System.Windows.Application.RunDispatcher(Object ignore)
   bei System.Windows.Application.RunInternal(Window window)

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 01 Feb 2017, 04:26 PM
Hi,

I am afraid that with the supplied information I cannot figure out what is going on. May I ask you to share more details on your case. What is the version of the controls? What are the needed steps for reproducing the issue?

It would be great if you can provide a runnable sample project which demonstrates the issue. I will debug it on my side and I will assist you further. You can do so, by opening a new support ticket.

Regards,
Yoan
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Philipp
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or