开发者

ArgumentOutOfRange exception on PagedCollectionView when removing items from the underlying ObservableCollection

开发者 https://www.devze.com 2023-03-05 07:40 出处:网络
I have an ObservableCollection of objects. I have a PagedCollectionView constructed from the ObservableCollection which is bound to a listbox.

I have an ObservableCollection of objects. I have a PagedCollectionView constructed from the ObservableCollection which is bound to a listbox.

When I call Remove on ObservableCollection PagedCollectionView throws an the ArgumentOutOfRange exception. Paramt开发者_如何学Cer:Index

What must I do to Remove an item from an ObservableCollection that is used this way.

Update: This issue may be related to the following bug reported on Microsoft Connect If that's true, then is there a workaround?


Have you tried RemoveAt? Do you have the same problem?

Annoying question: Do you need PagedCollectionView? (Are you using paging in your listbox?)

The best solution is to use Remove or RemoveAt on the actual PagedCollectionView, however. (If you do indeed even need it)

0

精彩评论

暂无评论...
验证码 换一张
取 消