Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RepositoryItemCheckedComboBoxEdit.Items Property

Gets the collection of check items to be displayed in the dropdown.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DXCategory("Data")]
public CheckedListBoxItemCollection Items { get; }

#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.

You should use the CheckedComboBoxEdit.SetEditValue method to select the “Circle” and “Ellipse” items. Then, to prevent users from deselecting it, disables the “Circle” item.

CheckedComboBoxEdit_ex

This code modifies the RepositoryItemCheckedComboBoxEdit.SeparatorChar property. This changes the edit value separator character from the default comma (“,”) to a semicolon (“;”). Ensure that the SetEditValue method uses this same separator character in its 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;
See Also