0

I have a list of check boxes in a page, dynamically generated from a JSON. I need a 'select all' check box also. How can I achieve this? How to select all check boxes together and set them all checked in code ?

Jaseem
  • 2,236
  • 6
  • 28
  • 35
  • check [this one](http://stackoverflow.com/questions/8292189/notifydatasetchanged-for-multiple-checkboxes/8342738#8342738) tested and works fine. – Lalit Poptani Jan 03 '12 at 14:10

2 Answers2

1

Just take one Boolean field check and on select all button/check box set it true and redraw list by notify data set change for list adepter .

On list adepter check if "check " flag is true then check the check box ...

loks
  • 490
  • 3
  • 10
0

I would mantain a List of checkboxes: List<Checkbox> allMyCheckboxes.

When building the list of checkboxes add each one to this list. Then the event for the select all checkbox would set the values for all the check boxes in this list.

helios
  • 13,574
  • 2
  • 45
  • 55