简体   繁体   中英

How to retrieve list of multi selected items from ListCollectionView

How do I get the list of selected items from a ListCollectionView? I see CurrentItem returns for single selection but I don't see anything to return the list of selected items in multi-select mode.

ListCollectionView or other types implementing ICollectionView are wrapper over source collection which WPF creates internally to bind with instead of direct binding to source collection. So, it does not have any such property to get selected items on GUI which is more or less a UI thing.

You need to get the SelectedItems from an UI component. ListCollectionView must be binded to ListBox . Access ListBox SelectedItems property to get selected items on view .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM