I am trying to do two way databinding with a RadComboBox when Checkboxes="true". Getting them to save to the database is fine but binding each checked item when reading from the database isnt working. The CheckedItems property is read only so that wont work. I tried this next:
'current' is an instance of an Person entity in my Entity Framework. A Person has a collection of branches. I want to bind the RadComboBox to all of the branches for the person.
Doing the above, only the last item in the RadComboBox will be checked. So, if the person has "Army" and "Navy" as branches and Army appears before Navy in the RCB, only Navy will be checked. Army will be unchecked.
Is there a way to set multiple checkboxes in a RadComboBox in C#?
Dim
branchBox
As
RadComboBox = FormView1.FindControl(
"branchBox"
)
For
Each
b
As
Branch
In
current.branches
For
Each
item
As
RadComboBoxItem
In
branchBox.Items
item.Checked = (b.branchId = item.Value)
Next
Next
'current' is an instance of an Person entity in my Entity Framework. A Person has a collection of branches. I want to bind the RadComboBox to all of the branches for the person.
Doing the above, only the last item in the RadComboBox will be checked. So, if the person has "Army" and "Navy" as branches and Army appears before Navy in the RCB, only Navy will be checked. Army will be unchecked.
Is there a way to set multiple checkboxes in a RadComboBox in C#?