Multiselect ListBox

。_饼干妹妹 提交于 2019-11-27 17:18:08

问题


I'm having trouble in multiple items selection in an ListBox.

I've tried deriving new control from Selector and writing ListBox helper class which did not work (as expected).

The issue with Selector class is, it does not expose SelectedItems and it's hell to bind the property and manipulate it with selection changed event.

The issue with ListBox Helper class is, I'm getting the required data on multiple selection but it never hits the bound property.

Does anybody know a better way to implement multiselect listbox?

Thanks in advance...


回答1:


The ListBox has multiple selection already implemented. Just change SelectionMode property to Multiple or Extened.

You can use SelectedItems property to get all the selected items afterwards.



来源:https://stackoverflow.com/questions/6412156/multiselect-listbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!