Skip to main content

RepositoryItemCheckedComboBoxEdit.GetCheckedItems() Method

Returns values of all currently checked items.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetCheckedItems() method.

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.

See Also