在选择WPF应用程序组合框中选择/取消选择所有

在选择WPF应用程序组合框中选择/取消选择所有

问题描述:

目前,我们有一个WPF应用程序使用Visual Studio 2010中有一个具有检查盒中有一个组合框中建在C#中,但我们希望那里是一个选择/取消选择所有选项。这将是基本相同你在在MS Excel 2007/2010,自动过滤器下拉列表,从中可以选择所有的复选框或取消选择所有复选框见。组合框是从外地在SQL压缩数据库,其记录取决于另一个组合框中(因此其他组合框充当哪些值,你会在这个下拉看到一个过滤器)中选择的值填充。

Currently we have a WPF application being built in C# using Visual Studio 2010. There is a combo box that has check-boxes in it, but we would like there to be a select/deselect all option. This would be essentially the same as what you see in the auto-filter drop-downs in MS Excel 2007/2010, where you can select all checkboxes or deselect all checkboxes. The combo box is populated from a field in a SQL Compact Database, whose records depend on the value selected in another combo box (so the other combo box acts as a filter for which values you would see in this drop-down).

这个功能已经在我们的板几个月,但技术团队不断的推背下一个版本,因为他们说这太难以实施。我上的应用,而不是实际的程序员业务分析师,但我想我会来这里引出一些帮助。

This feature has been on our plate for months, but the technical team keeps pushing back for the next release because they say it's too difficult to implement. I'm the business analyst on the application, not the actual programmer, but I figured I would come here to elicit some help.

这是真正的东西是很难实现(如,它至少需要一个星期来实现)?什么是去实现这个

Is this really something that is difficult to achieve (as in, it would take at least a week to implement)? What would be the way to go about achieving this?

下面是从别人上的 MSDN 。我创建了一个新的WPF项目,尝试一下......它的作品。您可以查看单个复选框。如果你勾选或取消勾选选择全部选项,所有其他的复选框被选中或取消选中相应。大约过了5分钟,创建和测试。

Here's a solution from someone on MSDN. I created a new WPF project to try it out... it works. You can check individual checkboxes. If you check or uncheck the Select All option, all other checkboxes are checked or unchecked accordingly. Took about 5 minutes to create and test.

当然,也可能是你的团队已经覆盖了控件的功能在某些方面或他们会打一些其他的限制,并不能实现这一点,但组合框应该支持。

Of course, it may be that your team has overridden the functionality of the control in some way or they'll hit some other limitation and not be able to implement this, but the combobox should support it.