Skip to main content
A newer version of this page is available. .

RepositoryItemCheckedComboBoxEdit.GetCheckedItems() Method

Returns values of all currently checked items.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v20.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public object GetCheckedItems()

Returns

Type Description
Object

A Object object that stores values of all currently checked items.

Remarks

Depending on the RepositoryItemCheckedComboBoxEdit.EditValueType, the type of the returned object differs.

#region Example 1
[Flags]
public enum MultiHue
{
    Black = 1,
    Red = 2,
    Green = 4,
    Blue = 8
};

checkedComboBoxEdit1.Properties.EditValueType = EditValueTypeCollection.CSV;
checkedComboBoxEdit1.Properties.Items.Clear();

checkedComboBoxEdit1.Properties.Items.Add(MultiHue.Black, "Flag item 1");
checkedComboBoxEdit1.Properties.Items.Add(MultiHue.Green, "Flag item 2");
checkedComboBoxEdit1.Properties.Items.Add(MultiHue.Red, "Flag item 3");

//GetCheckedItems returns the "Black, Gree, Red" string if all three items are checked

#endregion

#region Example 2

checkedComboBoxEdit1.Properties.EditValueType = EditValueTypeCollection.CSV;
checkedComboBoxEdit1.Properties.Items.Clear();

checkedComboBoxEdit1.Properties.Items.Add("One", "Item with string value");
checkedComboBoxEdit1.Properties.Items.Add(2, "Item with integer value");
checkedComboBoxEdit1.Properties.Items.Add(true, "Item with boolean value");

//GetCheckedItems returns the "One, 2, True" string if all three items are checked

#endregion
  • If the EditValueType is List, the method returns a List that contains checked items’ values.
checkedComboBoxEdit1.Properties.EditValueType = EditValueTypeCollection.List;
checkedComboBoxEdit1.Properties.Items.Clear();

checkedComboBoxEdit1.Properties.Items.Add("One", "Item with string value");
checkedComboBoxEdit1.Properties.Items.Add(2, "Item with integer value");
checkedComboBoxEdit1.Properties.Items.Add(true, "Item with boolean value");

//GetCheckedItems returns a System.Collections.Generic.List object that stores editor item values converted to strings
See Also