Reputation: 333
We are working on an application using the MVVM architectural style (WPF) and facing an issue. Before using WPF we have worked with WinForms and we used CheckedListBox. But now we are unable to find such control in WPF. We are also using Infragistic toolkit.
Please provide any kind of help. Any lead will be appreciable.
Upvotes: 2
Views: 2902
Reputation: 729
You can take a Listbox and give it a Template with a Checkbox in. Something like:
<ListBox ItemsSource="{Binding MyItems}">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected}" Content="{Binding}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
This looks like this:
Edit: The Items must have a Property "IsSelected" or you have to Wrap them in a SelectableItem helper class, which holds the original Item and a IsSelected Property.
Upvotes: 9