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

AlternateRowStyleSelector crash on scroll

5 Answers 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrik
Top achievements
Rank 1
Patrik asked on 19 Feb 2016, 08:34 AM

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

5 Answers, 1 is accepted

Sort by
0
Patrik
Top achievements
Rank 1
answered on 19 Feb 2016, 09:07 AM
Further testing indicates that it doesn't matter if I have a style selector for the RowStyleSelector property, it crashes anyway.
0
Patrik
Top achievements
Rank 1
answered on 19 Feb 2016, 09:14 AM

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)     

0
Patrik
Top achievements
Rank 1
answered on 19 Feb 2016, 10:10 AM
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.
0
Patrik
Top achievements
Rank 1
answered on 19 Feb 2016, 11:43 AM

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. 

0
Stefan
Telerik team
answered on 23 Feb 2016, 06:57 AM
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
Tags
GridView
Asked by
Patrik
Top achievements
Rank 1
Answers by
Patrik
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or