Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing item from ICollectionView


How can I remove item from ICollectionView in c#?

Dictionary<int, String> entityDict;
public ICollectionView DictView { get; set; }
dictView = CollectionViewSource.GetDefaultView(entityDict.Values);
dictView.//No remove method

Thanks

like image 469
Igal Avatar asked Jun 19 '11 08:06

Igal


2 Answers

You can't because it's a view of a collection. You need to remove the item from the underlying collection or use a filter. If you are interested in filtering then this question provides further information and links: WPF's ICollectionView.filter with large sets of data

like image 186
ChrisWue Avatar answered Oct 06 '22 16:10

ChrisWue


What ChrisWue says, is correct. You could check the Filter property of ICollectionView; perhaps it suits your needs.

like image 41
Frederik Gheysels Avatar answered Oct 06 '22 18:10

Frederik Gheysels