多选列表框
我在列表框中选择多个项目时遇到问题。
我尝试从 Selector 派生新的控件并编写 ListBox 辅助类,但它不起作用(如预期)。
Selector 类的问题是,它不公开 SelectedItems,并且绑定属性并使用选择更改事件操作它是地狱。
ListBox Helper 类的问题是,我在多项选择中获取所需的数据,但它永远不会命中绑定属性。
有人知道实现多选列表框的更好方法吗?
提前致谢...
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ListBox 已经实现了多重选择。只需将 SelectionMode 属性更改为 Multiple 或延长。
您可以使用 SelectedItems 属性来获取之后所有选定的项目。
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.