AlternateRowStyleSelector crash on scroll

6 posts, 0 answers
  1. Patrik
    Patrik avatar
    56 posts
    Member since:
    Jul 2010

    Posted 19 Feb Link to this post

    Hello!

    I have a RadGridView, styled using a theme and using RowStyleSelector and AlternateRowStyleSelector for coloring custom rows.

    This all work, but when have a bunch of rows custom colored and then when I scroll up, the browser crash with the following stacktrace:

    SCRIPT5022: Unhandled Error in Silverlight Application 
    Code: 4004    
    Category: ManagedRuntimeError       
    Message: System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component.
       vid MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       vid MS.Internal.XcpImports.ClearValue(IManagedPeerBase doh, DependencyProperty property)
       vid System.Windows.DependencyObject.ClearValueInternal(DependencyProperty dp)
       vid System.Windows.DependencyObject.ClearValue(DependencyProperty dp)
       vid Telerik.Windows.Controls.GridView.GridViewRow.ClearRowStyle(GridViewDataControl owningDataGrid)
       vid Telerik.Windows.Controls.GridView.GridViewRow.ClearRow(GridViewDataControl owningDataGrid)
       vid Telerik.Windows.Controls.GridView.GridViewDataControl.ClearContainerForItemOverride(DependencyObject element, Object item)
       vid Telerik.Windows.Controls.GridView.BaseItemsControl.Telerik.Windows.Controls.GridView.IGeneratorHost.ClearContainerForItem(DependencyObject container, Object item)

    The problem is, when I remove AlternateRowStyleSelector, no crash, but the coloring doesnt work.

    Do you have any ideas for a solution? I'm using a quite old version of the binaries (2014.1.0526.1050).

    Best regards,

    Patrik Edberg

  2. Patrik
    Patrik avatar
    56 posts
    Member since:
    Jul 2010

    Posted 19 Feb Link to this post

    Further testing indicates that it doesn't matter if I have a style selector for the RowStyleSelector property, it crashes anyway.
  3. DevCraft banner
  4. Patrik
    Patrik avatar
    56 posts
    Member since:
    Jul 2010

    Posted 19 Feb Link to this post

    Updated stacktrace:

     

    0x800a139e - Code: 4004    

    Category: ManagedRuntimeError       

    Message: System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component.
       vid MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       vid MS.Internal.XcpImports.ClearValue(IManagedPeerBase doh, DependencyProperty property)
       vid System.Windows.DependencyObject.ClearValueInternal(DependencyProperty dp)
       vid System.Windows.DependencyObject.ClearValue(DependencyProperty dp)
       vid Telerik.Windows.Controls.GridView.GridViewRow.ClearRowStyle(GridViewDataControl owningDataGrid)
       vid Telerik.Windows.Controls.GridView.GridViewRow.ClearRow(GridViewDataControl owningDataGrid)
       vid Telerik.Windows.Controls.GridView.GridViewDataControl.ClearContainerForItemOverride(DependencyObject element, Object item)
       vid Telerik.Windows.Controls.GridView.BaseItemsControl.Telerik.Windows.Controls.GridView.IGeneratorHost.ClearContainerForItem(DependencyObject container, Object item)
       vid Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.UnlinkContainerFromItem(DependencyObject container, Object item, Boolean isRecycled)
       vid Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Remove(GeneratorPosition position, Int32 count, Boolean isRecycling)
       vid Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IRecyclingItemContainerGenerator.Recycle(GeneratorPosition position, Int32 count)
       vid Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.CleanupRange(IItemContainerGenerator generator, Int32 startIndex, Int32 count)
       vid Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.CleanupContainers(Int32 firstViewport, BaseItemsControl itemsControl)
       vid Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.MeasureOverride(Size constraint)
       vid Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
       vid System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)     

  5. Patrik
    Patrik avatar
    56 posts
    Member since:
    Jul 2010

    Posted 19 Feb Link to this post

    The problem seems to be related to the binding of the background color property in the style selector, see attached screenshot. If I remove the binding and use a constant instead, it works and no crash.
  6. Patrik
    Patrik avatar
    56 posts
    Member since:
    Jul 2010

    Posted 19 Feb Link to this post

    I actually looked at this post: http://www.telerik.com/forums/radgridview---custom-cell-style-selector and by creating the style in the style selector the problem went away. 

  7. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 23 Feb Link to this post

    Hello Patrik,

    I am glad that you have found the cause of the issue you were experiencing.

    In addition check out the RowStyleSelectors help topic, and the relevant online demo as well.

    All the best,
    Stefan X1
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner