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

GridView crashes when using SortDescriptor

1 Answer 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Craig Dean
Top achievements
Rank 1
Craig Dean asked on 29 Jan 2010, 09:09 PM
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 dohDependencyProperty propertyPropertyInvalidationReason reason)
at System.Windows.DependencyObject.ClearValueInternal(DependencyProperty dp)
at System.Windows.DependencyObject.ClearValue(DependencyProperty dp)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.CleanupContainers(Int32 firstViewportBaseItemsControl itemsControl)
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTargetSingle inWidthSingle inHeightref Single outWidthref 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.

1 Answer, 1 is accepted

Sort by
0
Craig Dean
Top achievements
Rank 1
answered on 30 Jan 2010, 12:36 AM
OK,

Being getting loads of weird bugs in Telerik controls, turns out that I was changing the ApplicationTheme after some controls rendered, most of the contros die horribly if you change the theme once they're rendered.

Absolutely impossible to trace, very lucky to figure it out!
Tags
GridView
Asked by
Craig Dean
Top achievements
Rank 1
Answers by
Craig Dean
Top achievements
Rank 1
Share this question
or