Select all rows and deselect all rows in the list

I have a list view with a check box in each row to select this row ... And I have a Select All checkbox above the list to click all rows by clicking and vice versa ... is it possible to do this ...

+3
source share
3 answers
ListItem item = default(ListItem);
foreach ( item in MyListView.ListItems) {
    item.Selected = true;
}

you can use the checkbox id instead of the item and set it to check or vice versa.

+3
source

You can solve this problem even easier simply by using 2 methods.

listView.clearChoices();
listView.requestLayout();
+18
source

The ListView object has a clearChoices () method.

+2
source

Source: https://habr.com/ru/post/1778670/


All Articles