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

ExpressionColumn crashes when sorting

3 Answers 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Maurizio
Top achievements
Rank 2
Maurizio asked on 04 Nov 2014, 05:07 PM
I have a RadGridView that is working nicely, but  I have trouble with the expression Column:

1) I let the expression Column show via right mouse click. It is empty.
2) I click the Header of the Explession Column
3) RadGridView obviously tries to sort the empty Expression Column and  crashes with the CallStack posted below.

I want GridView to be stable, so whatever the user does it should not crash only because the Expression column is empty

How do I achieve this?



bei System.Linq.Expressions.Expression.Lambda(Expression body, String name, Boolean tailCall, IEnumerable`1 parameters)
bei System.Linq.Expressions.Expression.Lambda(Expression body, ParameterExpression[] parameters)
bei Telerik.Windows.Data.Expressions.SortDescriptorCollectionExpressionBuilder.Sort()
bei Telerik.Windows.Data.QueryableExtensions.Sort(IQueryable source, IEnumerable`1 sortDescriptors)
bei Telerik.Windows.Data.QueryableExtensions.Sort(IQueryable source, SortDescriptorCollection sortDescriptors)
bei Telerik.Windows.Data.QueryableCollectionView.get_FilterAndSortQueryableSourceCollection()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.CreateAggregateResults()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.CalculateAggregates()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Controls.DataControl.OnItemsCollectionChangedDispatch(Object sender, NotifyCollectionChangedEventArgs e)
bei System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.Listener`2.ReceiveWeakEvent(Object sender, TArgs args)
bei Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
bei Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
bei Telerik.Windows.Data.QueryableCollectionView.RefreshOverride()
bei Telerik.Windows.Data.QueryableCollectionView.RefreshInternal()
bei Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer()
bei Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
bei Telerik.Windows.Data.QueryableCollectionView.OnSortDescriptorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
bei System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
bei System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
bei Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target, Func`2 itemConverter)
bei Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target)
bei Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
bei Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
bei Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
bei System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.PerformSorting(GridViewSortingEventArgs sortingArgs)
bei Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass9b.<Sort>b__9a()
bei Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
bei Telerik.Windows.Controls.GridView.GridViewDataControl.Sort(GridViewColumn column, Boolean appendToExisting)
bei Telerik.Windows.Controls.GridView.GridViewHeaderCell.RequestSort(Boolean appendToExisting)
bei Telerik.Windows.Controls.GridView.GridViewHeaderCell.PerformUserSort()
bei Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnMouseLeftButtonUp(MouseButtonEventArgs e)
bei System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
bei System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
bei System.Windows.Input.InputManager.ProcessStagingArea()
bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei System.Windows.Interop.HwndSource.InputFilterMessage(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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
bei System.Windows.Threading.Dispatcher.Run()
bei System.Windows.Application.RunDispatcher(Object ignore)
bei System.Windows.Application.RunInternal(Window window)
bei System.Windows.Application.Run(Window window)
bei System.Windows.Application.Run()
bei Roka3.App.Main() in C:\RZVN\Roka3\Roka3\obj\x86\Debug\App.g.cs:Zeile 0.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 05 Nov 2014, 04:06 PM
Hello,

I was able to reproduce the issue, it seems to be a bug at our side. I logged it into our system for a further investigation. You can follow its progress on our feedback portal here:
http://feedback.telerik.com/Project/143/Feedback/Details/142612-empty-expressioncolumn-crashes-when-sorting

Meanwhile, in order to avoid the crash you can configure the column with IsSortable="False".
For example:
<telerik:GridViewExpressionColumn IsSortable="False"/>

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Maurizio
Top achievements
Rank 2
answered on 03 Mar 2015, 02:58 PM
Hi Dimitrina,

I was hoping that the bug was removed, but unfortunately it still exists in the 2015Q1 release, that I just downloaded. 

It should not be too hat to fix. Your developers just have to intercept a null state...
0
Dimitrina
Telerik team
answered on 03 Mar 2015, 03:44 PM
Hi Peter,

As it turns out it is indeed not resolved as the case is more complicated than just intercepting the null memberAccessExpression we build internally. Since sorting is a data operation and in this case there is not a member presented to sort by, the error occurs.

I raised its priority so that we can address it sooner. You can follow the feedback item to get updated once there is a change in the status of the issue.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Maurizio
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Maurizio
Top achievements
Rank 2
Share this question
or