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

ArgumentOutOfRangeException from cell in edit mode

1 Answer 14 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 17 Jan 2012, 02:54 AM
In our view model we are clearing out an observerable collection (Schedule.Clear()) while a cell grid is in edit mode and we are getting the following exception.

Any ideas? We have a workaround for now where assign a new observable collection to the property but would rather clear.

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

Parameter name: index

at Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCurrentEdit(GridViewRow gridViewRow)

at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformRowEditEnded(GridViewCell currentCell)

at Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCellEdit(GridViewCell currentCell, Boolean isLeavingRow)

at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsChanged(NotifyCollectionChangedEventArgs e)

at Telerik.Windows.Controls.GridView.BaseItemsControl.OnItemCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)

at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)

at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(NotifyCollectionChangedEventArgs e)

at Telerik.Windows.Data.QueryableCollectionView.RefreshOverride()

at Telerik.Windows.Data.QueryableCollectionView.RefreshInternal()

at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
(More that was removed, but entry point from our code)

 

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 17 Jan 2012, 10:16 AM
Hello,

Where do you call the Clear() method for the bound collection? Could you just share with us what kind of data you are using as ItemsSource? It is a simple List, an ObservableCollection, or something else?

I have tested clearing the collection (ObservableCollection) on a button click and it was cleared fine.


Regards,
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
GridView
Asked by
Dave
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or