Saturday, August 29, 2009

Binding Checkbox with the Listview Item Selection

Hi All,

I know, lot of people juggle around for this. I also did ;)

Have you ever wondered to have a checkbox in a listview item which should be checked/unchecked as per the listviewitem selection and vice versa?

Suppose if you have a checkbox as a listview item, and you want to check/uncheck the checkbox as soon as user selects the listview item. And vice versa, the listview item should be selected as soon as user selects the checkbox. The following line solves this purpose :

Vikas Bhandari


Artem said...

Hi, аs I understand it will be selected checkbox which is in current selected listview item. How to make that in previous selected item check box also stay selected???

Vikas Bhandari said...

Make your listview as multiselect. It should do it by default.