多选WinForms列表框中的双向绑定? [英] Two Way Binding on Multi-select WinForms Listbox?

查看:238
本文介绍了多选WinForms列表框中的双向绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我们正在从一组对象加载一个多选列表框。

我有另一个实体对象有一个集合,我想以某种方式绑定到SelectedItems。



有没有办法使用对象绑定源或某种绑定源而不编写代码?当然,我可以循环收集并获取所选项目,但我更愿意使用Windows数据绑定更干净地执行。



这是可能吗?

解决方案

不幸的是你无法绑定SelectedItems(或CheckedListBox中的CheckedItem)...我无法知道我希望有多少次可能!


I have a project where we are loading a multi-select listbox from a collection of objects.
I have another entity object that has a collection that I want to bind to SelectedItems somehow.

Is there any way to do this using object binding sources or some kind of binding source without writing code? Sure I can loop through the collection and get the selected items but I'd prefer to do it more cleanly with windows data-binding.

Is this possible?

解决方案

Unfortunately you can't bind the SelectedItems (or CheckedItems in CheckedListBox)... I can't tell how many times I wished it were possible !

这篇关于多选WinForms列表框中的双向绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆