We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Get the checked items of a CheckListBox

Thread ID:

Created:

Updated:

Platform:

Replies:

120688 Oct 4,2015 09:02 AM Feb 19,2018 06:17 AM WPF 7
loading
Tags: PDF
Fabio Henrique Baptista
Asked On October 4, 2015 09:02 AM

Hi,

How can I get the items that are checked in my CheckListBox, I tried SeletecItem property, connected with a List <>, but had no success.

ps. I'm using MVVM.

thanks


Muthukumar A [Syncfusion]
Replied On October 5, 2015 03:29 AM

Hi Fabio,

Thanks for contacting Syncfusion Support.

Since CheckListBox has been inherited from MultiSelector, its SelectedItems Property is Hidden and ReadOnly. So using the SelectedItems in MVVM is not possible.
But we can achieve your requirement by two ways,

First way:
Include bool property, say "IsSelected" in Model level and bind this property with IsSelected of CheckListBoxItem. This can be done by modifying the ItemsContainerStyle of Control. And then while the property changes, write your codes to preserve SelectedItems.

Second Way: Including either AttachedProperty or Behavior
Here we need to provide new attached property to hold the selected items of control. Unlike previous way, this will support full XAMl binding in MVVM.

We have created a demo sample that tries to explain above methods. You can download the sample from the below location.

Sample:
CheckedListBox_Sample


Please let us know if the sample helps or in case of any other query.

Regards,
Muthukumar A

Fabio Henrique Baptista
Replied On October 5, 2015 06:51 PM

Hi,

Thank you, it worked perfectly.

Fabio

Muthukumar A [Syncfusion]
Replied On October 6, 2015 12:47 AM

Hi Fabio,

We are glad to hear that your requirement is fulfilled.

Please let us know if you need any further assistance on this.

Regards,
Muthukumar A

Andy Pybus
Replied On June 11, 2017 03:17 PM

Dear Muthukumar,

I want to use the CheckListBox control in a simple dialog window.

I am not using MVVM.

I require that only a single item can be selected.

Can you recommend a way to do this?

Regards,

Andy Pybus

Keerthana Jegannathan [Syncfusion]
Replied On June 12, 2017 04:49 AM

Hi Andy, 
 
Thanks for your update. 
 
We suspect that your requirement is to check only one item from CheckListBox control at a time, if so we have prepared a workaround sample to meet your requirement in which we have changed the “IsSelected” property of the previously checked item to false once new item has been checked in SelectionChanged event of the CheckListBox control and it can be downloaded from the below location. 
 
 
Regards, 
Keerthana J 


naveen
Replied On February 16, 2018 01:15 AM

i need xamarin pdf

Sowmiya Loganathan [Syncfusion]
Replied On February 19, 2018 06:17 AM

Hi Fabio, 

Could you please provide more information about what feature you need from Xamarin PDF. It would be helpful for us to provide a precise solution. 

For more information about PDF, please refer the below UG documentation link: 
Please refer the below PDF Feature Tool link for your reference: 

Please let us know if you need further assistance on this. 

Regards, 
Sowmiya L 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;