how to select all listview items?
If there aren't very many items, this will do it:
foreach (ListViewItem item in myListView.Items)
{
item.Selected = true;
}
If there are a lot of items, see this answer for how to use LVM_SETITEMSTATE
.
Just pass your listview and checkstate to the function.
public void CheckAllItems(ListView lvw, bool check)
{
lvw.Items.OfType<ListViewItem>().ToList().ForEach(item => item.Checked = check);
}