Project Description:

WPF dosen't come up with default checked listbox. In this project you will find usercontrol which acts as checked listbox. 

WPF Checked ListBox 


Property: SelectedValues 

Event: SelectedItemChanged

Below are the steps to use this project.

Step 1: Add reference to WpfCheckedListBox.dll project

Download the sample by clicking on the download button. After you download you will find WpfCheckListBox.dll. Copy this dll in your project directory and add reference to to this dll in the project you want to use this control.

Add refrence

Step 2: Add WpfCheckedListBox in XAML.

 <WpfCheckListBox:CheckedListBox x:Name="wpfCheckListBox" >
            
</WpfCheckListBox:CheckedListBox>

Step 3: Create a collection of CheckedListBoxItem to bind to the list

 

 var items=new ObservableCollection<CheckedListBoxItem>
                      {
                       new CheckedListBoxItem("America","America", false),
                       new CheckedListBoxItem("Europe","Europe", false),
                       new CheckedListBoxItem("Asia","Asia", false),
                       new CheckedListBoxItem("Australia","Australia", false)
                       };

 

Step 4: Bind the above list to check list box

 

wpfCheckListBox.ListBox.ItemsSource = items;

Last edited Nov 20, 2012 at 5:31 PM by bpoojary, version 8