GridView crashes when using SortDescriptor

2 posts, 0 answers
  1. Craig Dean
    Craig Dean avatar
    16 posts
    Member since:
    Jan 2010

    Posted 29 Jan 2010 Link to this post

    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.
  2. Craig Dean
    Craig Dean avatar
    16 posts
    Member since:
    Jan 2010

    Posted 29 Jan 2010 Link to this post

    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!
  3. DevCraft banner
Back to Top