RepositoryItemCheckedComboBoxEdit.Items Property
Gets the collection of check items to be displayed in the dropdown.
Namespace: DevExpress.XtraEditors.Repository
Assembly: DevExpress.XtraEditors.v19.1.dll
Declaration
Property Value
Type | Description |
---|---|
CheckedListBoxItemCollection | A CheckedListBoxItemCollection collection. |
Remarks
Items in the collection are represented by CheckedListBoxItem objects.
You can add items to the collection directly using methods provided by the CheckedListBoxItemCollection class. To add items to the collection to represent flags of a bit field, use the RepositoryItemCheckedComboBoxEdit.SetFlags method. To add items that represent elements of an enumeration to the collection, use the RepositoryItemCheckedComboBoxEdit.AddEnum method overloads.
In bound mode, the Items collection is not populated immediately when binding to a data source. To force data population, call the RepositoryItemCheckedComboBoxEdit.GetItems method.
Example
The code below populates the RepositoryItemCheckedComboBoxEdit.Items
collection with five items, each item stores a string value.
The CheckedComboBoxEdit.SetEditValue method is called to select “Circle” and “Ellipse” items. The “Circle” item is then disabled so that users cannot de-select it.
Note that the code modifies the RepositoryItemCheckedComboBoxEdit.SeparatorChar property to change the edit value separator char from the default comma (“,”) to a semicolon (“;”). The same separator char must be used in the SetEditValue method parameter.
// Add check items to the control's dropdown.
string[] itemValues = new string[] {
"Circle", "Rectangle", "Ellipse",
"Triangle", "Square" };
foreach (string value in itemValues)
checkedComboBoxEdit1.Properties.Items.Add(value, CheckState.Unchecked, true);
// Specify the separator character.
checkedComboBoxEdit1.Properties.SeparatorChar = ';';
// Set the edit value.
checkedComboBoxEdit1.SetEditValue("Circle; Ellipse");
// Disable the Circle item.
checkedComboBoxEdit1.Properties.Items["Circle"].Enabled = false;
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Items property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.