C# 在ComboBoxEdit中选择几个项目
我将()与过滤器的设置一起使用。如何通过代码选择一些项目?根据文档: 要编辑一组布尔选项,请将相应的项添加到RepositoryItemCheckedComboBoxEdit.items集合。每个项目都由CheckedListBoxItem对象表示,提供以下选项: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
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]);