Setting/reading selected items in checklistbox from viemodel

Hi

My checklistbox itemssource is binding to datatable  and defined as   DisplayMemberPath="nazwa"  SelectedValuePath="id" 

Now I want  to get/set selected items from viemodel  by id - what is the best way to achieve this ? 

1 Reply

GS Gokul Sainarayanan Syncfusion Team May 22, 2018 03:59 AM UTC

Hi Bartosz,

We have checked your reported query with the CheckListBox and have prepared a sample for the same in which we have binded the ItemSource to the dataTable. We have retrieved the value based on id from the returned DataRowView type and we have also set the SelectedItem based on the id value. Also note that when selecting items programmatically, previously selected items will be unselected and the specified item alone will be selected. Please download the sample from the following location.

Link: http://www.syncfusion.com/downloads/support/forum/137615/ze/CheckListBoxSample11073184552

Please let us know if you have any further queries.

Regards,
Gokul S

Loader.
Up arrow icon