Skip to main content

RepositoryItemCheckedComboBoxEdit.DataSource Property

Gets or sets the data source whose items are displayed in the control’s dropdown.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.2.dll

Declaration

[DefaultValue(null)]
[DXCategory("Data")]
public virtual object DataSource { get; set; }

Property Value

Type Default Description
Object null

A data source whose items are displayed in the control’s dropdown.

Remarks

When a data source is assigned to the DataSource property, the RepositoryItemCheckedComboBoxEdit.Items collection is populated with check items that represent the assigned data records.

The data source assigned must contain a field that uniquely identifies check items. Assign this field to the RepositoryItemCheckedComboBoxEdit.ValueMember property. Values of this field will be used to initialize the ListBoxItem.Value property of the created check items.

A data source may also contain a field containing the display text of check items. To initialize the display text of the created check items with values in this field, set the field’s name to the RepositoryItemCheckedComboBoxEdit.DisplayMember property.

After the check item collection has been populated, you can customize the check items in any way you want. For instance, you can change the items’ display text via the CheckedListBoxItem.Description property.

Assigning a new data source to the DataSource property destroys the existing check items, if any, and then repopulates the check item collection. Adding, removing or updating records in the data source that is assigned to the DataSource property doesn’t update the current check item collection.

See Also