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

[Solved] InvalidOperationException when removing an item from ObservableCollection bound to a RadDataGrid

1 Answer 120 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Markus
Top achievements
Rank 1
Markus asked on 13 Apr 2013, 02:17 PM
Hello,

upon removing an item from an ObservableCollection that is bound to the ItemsSource of a RadDataGrid, I get an InvalidOperationException with the following stacktrace.


System.InvalidOperationException
   at System.Linq.Enumerable.Last[TSource](IEnumerable`1 source)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`1.GenerateContainer(IList`1 itemInfos)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`1.GenerateBottomBufferItems(Int32 startGenerateIndex, Double viewportLength)
   at Telerik.UI.Xaml.Controls.Grid.NodePool`1.OnMeasure(RadSize availableSize, Double offset)
   at Telerik.UI.Xaml.Controls.Grid.GridModel.MeasureCells(RadSize newAvailableSize)
   at Telerik.UI.Xaml.Controls.Grid.RadDataGrid.OnCellsPanelMeasure(RadSize newAvailableSize)
   at Telerik.UI.Xaml.Controls.Grid.Primitives.DataGridCellsPanel.MeasureOverride(Size availableSize)

Whether the item is selected or not makes no difference.

Is there a workaround?

EDIT: Ok, the workaround is to replace the entire list with a new one after removing the desired item.

So will there be a fix for this any time soon (maybe in the Q2 release)?

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivaylo Gergov
Telerik team
answered on 15 Apr 2013, 02:16 PM
Hello Markus,

Thank you for contacting us.

Indeed we are aware of this issue and it is already fixed in our latest internal build (you can download it from your client account -> Manage Products -> Latest internal builds). The fix will also be included in our official Q1 2013 SP1 release later this week.

I hope this information helps.

 

Kind regards,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Grid for XAML
Asked by
Markus
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Share this question
or