3

I have a list view with a check box in each row to select that row... And i have a select all check box above the listview to select all the rows at a click and vice versa... is it possible to do so...

xydev
  • 3,409
  • 5
  • 34
  • 54
  • You've prolly made a Custom Adapter...just add a special function for `select all` that enables all checkboxes inside your adapter. – st0le Dec 06 '10 at 05:10

3 Answers3

18

You can resolve this even easier by simply using 2 methods.

listView.clearChoices();
listView.requestLayout();
Dmitry Zaytsev
  • 23,650
  • 14
  • 92
  • 146
BriCo84
  • 881
  • 1
  • 8
  • 10
3
ListItem item = default(ListItem);
foreach ( item in MyListView.ListItems) {
    item.Selected = true;
}

you can use checkbox id instead of item and set it checked or vice versa.

laalto
  • 150,114
  • 66
  • 286
  • 303
sam
  • 685
  • 7
  • 17
2

The object ListView has a method called clearChoices().

Guilherme Oliveira
  • 2,132
  • 1
  • 14
  • 20