Home Forums WPF controls Xceed DataGrid for WPF Bug: crash on sort grouped

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • obiben
    Participant
    Post count: 28
    #43816 |

    Hi there,

    There seems to be a problem with sorting with the same field as the table is grouped by. Whenever there are empty values, the program crashes. No crash when sorting the same column without grouping.

    This is true for all fields types I’ve tried (int, decimal, string, DateTime). Here’s a sample stack trace:
    Exception Text **************
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> Xceed.Wpf.DataGrid.DataGridInternalException: An unexpected internal failure occurred in the Xceed WPF DataGrid control. —> System.ArgumentException: Object must be of type String.
    at System.String.CompareTo(Object value)
    at Xceed.Wpf.DataGrid.ObjectComparer.Compare(Object xData, Object yData)
    at Xceed.Wpf.DataGrid.GroupSortComparer.Compare(DataGridCollectionViewGroup xGroup, DataGridCollectionViewGroup yGroup)
    at Xceed.Wpf.DataGrid.DataGridCollectionViewGroupSort.Compare(Int32 xDataIndex, Int32 yDataIndex)
    at Xceed.Utils.Collections.IndexWeakHeapSort.MergeForest(Int32 m)
    at Xceed.Utils.Collections.IndexWeakHeapSort.Sort(Int32 length)
    at Xceed.Wpf.DataGrid.DataGridCollectionViewGroup.SortItems(SortDescriptionInfo[] sortDescriptionInfos, List1 groupSortComparers, Int32 level, List1 globalRawItems, DataGridCollectionViewGroup newSortedGroup)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.SortItems(SortDescriptionInfo[] sortDescriptionInfos)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.ExecuteSourceItemOperation(DeferredOperation deferredOperation, Boolean& refreshForced)
    at Xceed.Wpf.DataGrid.DeferredOperationManager.Process(Boolean processAll)
    at Xceed.Wpf.DataGrid.DataGridCollectionViewBase.DeferRefreshHelper.ProcessDispose(DataGridCollectionViewBase collectionView)
    at Xceed.Wpf.DataGrid.DataGridCollectionViewBase.DeferRefreshHelper.Dispose(Boolean disposing)
    at Xceed.Wpf.DataGrid.DataGridCollectionViewBase.DeferRefreshHelper.System.IDisposable.Dispose()
    at Xceed.Wpf.DataGrid.DataGridSortDescriptionCollection.DeferResortDisposable.Dispose()
    at Xceed.Wpf.DataGrid.ColumnSortCommand.Disposer.Dispose(Boolean disposing)
    End of inner exception stack trace —
    at Xceed.Wpf.DataGrid.ColumnSortCommand.Disposer.Dispose(Boolean disposing)
    at Xceed.Wpf.DataGrid.ColumnSortCommand.Disposer.Dispose()
    at Xceed.Wpf.DataGrid.ToggleColumnSortCommand.ToggleColumnSort(ColumnBase column, SortDirection direction, Boolean resetSort)
    at Xceed.Wpf.DataGrid.ToggleColumnSortCommand.ExecuteCore(ColumnBase column, SortDirection direction, Boolean resetSort)
    at Xceed.Wpf.DataGrid.ToggleColumnSortCommand.Execute(ColumnBase column, Boolean resetSort)
    at Xceed.Wpf.DataGrid.GroupByItem.OnMouseLeftButtonUp(MouseButtonEventArgs e)
    at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
    at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
    at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
    at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
    at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
    at System.Windows.Input.InputManager.ProcessStagingArea()
    at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
    at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
    at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
    at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
    at System.Windows.Application.RunDispatcher(Object ignore)
    at System.Windows.Application.RunInternal(Window window)
    at System.Windows.Application.Run(Window window)
    at QJExternalTool.ExternalTool.InitializeTool(IHost host)
    End of inner exception stack trace —
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at QJ.TradingManager.ExternTool.InitializeTool(IHost host)
    at QJ.TradingManager.ExternTool.CreateTool()
    at QJ.Trader.GUI.frmMainControl.mnuExternTool_Click(Object sender, EventArgs e)
    at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
    at System.Windows.Forms.MenuItem.MenuItemData.Execute()
    at System.Windows.Forms.Command.Invoke()
    at System.Windows.Forms.Command.DispatchID(Int32 id)
    at System.Windows.Forms.Control.WmCommand(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.Form.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    I was not able to reproduce the issue using the latest version of the grid V5.9. If you are not using the latest version, could you upgrade and tell me if the issue persists. If yes, can you send me a simple stand alone sample project which reproduces the issue so that I could have a closer look. You may send it to: support@xceed.com

    You can refer to the following section on our website to download V5.9 at:

    Xceed DataGrid for WPF

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.