Data Binding
Supported Bindable Types
As an inheritor of RadListView, RadCheckedListBox extends its functionality and provides a way to bind your RadCheckedListBox check boxes to a data source. There are several types of data that CheckedMember can be bound to:
Boolean – True represents ToggleState.On and False – ToggleState.Off.
Numeric – 0 represents ToggleState.Off, any other value is calculated as ToggleState.On.
ToggleState enumeration.
CheckState enumeration.
String – representing CheckBox ToggleState.On state with values like: "True", "On" and "T", ToggleState.Indeterminate state with value "indeterminate", ToggleState.Off state with any other value.
Information about RadListView data binding is available here: RadListView Data Binding.
Design Time
To data bind the checkboxes of RadCheckedListBox you need to set CheckedMember using the smart tag or the properties window.
The result is data bound CheckedListBox
Binding Programmatically
The following example demonstrates how you can bind the control by using the CheckedMember property. This example uses the CheckState property of the business object.
1. Initially let’s create a collection of objects.
2. To support three state check boxes we need to set the ThreeStateMode property:
3. And finally set programmatically the DataSource, DisplayMember, ValueMember and CheckedMember properties.