I have a GridView bound to an ObservableCollection. It works perfectly until I add a SortDescriptor.
When the grid first loads it's data it sorts it fine, but when I later programmatically add something to the collection it throws the following exception:
{MS.Internal.WrappedException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.FrameworkElement_SetStyleValue(FrameworkElement doh, DependencyProperty property, PropertyInvalidationReason reason)
at System.Windows.DependencyObject.ClearValueInternal(DependencyProperty dp)
at System.Windows.DependencyObject.ClearValue(DependencyProperty dp)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.CleanupContainers(Int32 firstViewport, BaseItemsControl itemsControl)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, ref Single outWidth, ref Single outHeight)
--- End of inner exception stack trace ---}
Removing the SortDescriptor solves the problem, but I would like the list to be sorted. The items are being added to the collection on the UI thread.
When the grid first loads it's data it sorts it fine, but when I later programmatically add something to the collection it throws the following exception:
{MS.Internal.WrappedException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.FrameworkElement_SetStyleValue(FrameworkElement doh, DependencyProperty property, PropertyInvalidationReason reason)
at System.Windows.DependencyObject.ClearValueInternal(DependencyProperty dp)
at System.Windows.DependencyObject.ClearValue(DependencyProperty dp)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.CleanupContainers(Int32 firstViewport, BaseItemsControl itemsControl)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, ref Single outWidth, ref Single outHeight)
--- End of inner exception stack trace ---}
Removing the SortDescriptor solves the problem, but I would like the list to be sorted. The items are being added to the collection on the UI thread.