Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在ComboBoxEdit中选择几个项目_C#_Wpf_Visual Studio 2010_Devexpress - Fatal编程技术网

C# 在ComboBoxEdit中选择几个项目

C# 在ComboBoxEdit中选择几个项目,c#,wpf,visual-studio-2010,devexpress,C#,Wpf,Visual Studio 2010,Devexpress,我将()与过滤器的设置一起使用。如何通过代码选择一些项目?根据文档: 要编辑一组布尔选项,请将相应的项添加到RepositoryItemCheckedComboBoxEdit.items集合。每个项目都由CheckedListBoxItem对象表示,提供以下选项: ListBoxItem.Value - represents the item's value. Typically, this property must specify a unique string. For check it

我将()与过滤器的设置一起使用。如何通过代码选择一些项目?

根据文档:

要编辑一组布尔选项,请将相应的项添加到RepositoryItemCheckedComboBoxEdit.items集合。每个项目都由CheckedListBoxItem对象表示,提供以下选项:

ListBoxItem.Value - represents the item's value. Typically, this property must specify a unique string. For check items, it's also possible to specify the display text via the CheckedListBoxItem.Description property.
CheckedListBoxItem.CheckState - represents the item's check state (checked or unchecked). The indeterminate state is not supported.
CheckedListBoxItem.Enabled - specifies whether the item's state can be changed by an end-user.

请将必需的项目添加到集合中

标记:

xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
...
<dxe:ComboBoxEdit x:Name="cbEdit" IsTextEditable="False">
    <dxe:ComboBoxEdit.StyleSettings>
        <dxe:CheckedComboBoxStyleSettings />
    </dxe:ComboBoxEdit.StyleSettings>
</dxe:ComboBoxEdit>

windows窗体对吗?如何用项目填充ComboBox控件?是否尝试在所有可用项上循环并设置选中/选定属性?WPF。使用ItemsSource填充此帮助?我希望如此。明天可以查。谢谢。
string[] platforms = new string[] { "Win98", "Win2000", "WinNT", "WinXP", "Vista", "Win7" };
cbEdit.ItemsSource = platforms;
cbEdit.SelectedItems.Add(platforms[4]);
cbEdit.SelectedItems.Add(platforms[5]);