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

exception while changing multiple enum values in background data

1 Answer 33 Views
GridView
This is a migrated thread and some comments may be shown as answers.
marc
Top achievements
Rank 1
marc asked on 17 Apr 2012, 05:13 PM
for the last 2 hours I've been trying to figure this one out. i have a column displaying an enum value. the enum value is displayed using a custom template and works fine. every enum value has its corresponding icon. now i was asked to provide a way to edit all the selected rows at once. the data behind are observableobjects (INotifyPropertyChanged). My code is simple, after setting a value in a dialog and accepting, I modify all the selected elements property to the new value. this works fine for string and double by the way. it also mostly works for my enum, but sometimes (mainly when i repeat this process quickly) i get a crash with the (consistent) error listed below.

I removed my template and the code worked. if i only display text in my template and no icon, it also seems fine. the main reason, why i think this must be telerik related, or at least a combination effect: I dont get an exception in my own code and can not debug a thing. if i edit the cells directly i also have no problems. it only seems to occur by modifying multiple data-objects at once.

I've also tried the following: prevent my objects notifying that the enum value has changed -> no exception. then calling rebind on the grid -> same exception.

Telerik.Windows.Data, Version=2012.1.215.40

System.ArgumenNullException: {"Der Wert darf nicht NULL sein.\r\nParametername: element"} //german: element is null

bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei System.Linq.Enumerable.<OfTypeIterator>d__aa`1.MoveNext()
   bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   bei Telerik.Windows.Controls.GridView.GridViewCell.<GetDataErrors>d__7.MoveNext()
   bei Telerik.Windows.Data.EnumerableExtensions.Count(IEnumerable source)
   bei Telerik.Windows.Controls.GridView.GridViewCell.UpdateIsValidState()
   bei Telerik.Windows.Controls.GridView.GridViewCell.UpdateValue()
   bei Telerik.Windows.Controls.GridView.GridViewCell.SetCellElement()
   bei Telerik.Windows.Controls.GridView.GridViewRow.PrepareCell(GridViewCellBase cellBase, GridViewColumn column)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.PrepareCell(GridViewCellBase cell, GridViewColumn column)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.GetVirtualizedCell(GridViewColumn column, Boolean createIfNull)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32 startIndex, Int32 predictedLastIndex, Func`2 calculateNextIndex)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.UpdateVirtualizedCells()
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize)
   bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   bei System.Windows.UIElement.Measure(Size availableSize)
   bei System.Windows.ContextLayoutManager.UpdateLayout()

1 Answer, 1 is accepted

Sort by
0
marc
Top achievements
Rank 1
answered on 17 Apr 2012, 05:30 PM
i might have found the origin of the issue. i did not map all enum values to images. so possibly there is an exception in xaml (whats odd, as it works with single selection). but if it stays like this, i guess i am happy. but still very confused.
Tags
GridView
Asked by
marc
Top achievements
Rank 1
Answers by
marc
Top achievements
Rank 1
Share this question
or