aby
aby

Reputation: 830

how to set selected elements in DevExpress' CheckedComboBoxEdit

I'm a newbie for DevExpress controls. I have a DevExpress checkedComboBoxEdit control that is populated by data from SQL Server using Linq. Populating the checkedComboBox elements worked fine but I couldn't figure out how to set the selected elements.

The DB table contains three fields

I want to select the checkbox elements based on the Applies field. How can I do this? Or is there a better way of doing this by modifying the database table? Or is there a CheckedComboBox property to do this?

Thanks

Upvotes: 2

Views: 7355

Answers (2)

Anees Al-Ahsab
Anees Al-Ahsab

Reputation: 1

To Unchecked all items in CheckedComboBoxEdit

  For i = 0 To CheckedComboBoxEdit1.Properties.Items.Count - 1
       clUSER_ID.CheckedComboBoxEdit1.Items.Item(i).CheckState = 
       CheckState.Unchecked
   Next

Upvotes: 0

shamp00
shamp00

Reputation: 11326

You should find all you need in the DevExpress online doumentation. In particular:

To initialize the check items' values and display text with values of these fields, assign the names of the fields to the RepositoryItemCheckedComboBoxEdit.ValueMember and RepositoryItemCheckedComboBoxEdit.DisplayMember properties.

So in your case, you should assign 'Role' to the DisplayMember property and 'Applies' to the ValueMember property (rather than 'id').

Upvotes: 2

Related Questions