开发者

Removing item from ICollectionView

开发者 https://www.devze.com 2023-03-14 03:02 出处:网络
How can I re开发者_开发问答move item from ICollectionView in c#? Dictionary<int, String> entityDict;

How can I re开发者_开发问答move item from ICollectionView in c#?

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

Thanks


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


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

0

精彩评论

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