Hello,
How can I check if no items "At all" selected from listview?
Thanks.
Hello,
How can I check if no items "At all" selected from listview?
Thanks.
if( myListView.SelectedItems == null || myListView.SelectedItems.Count == 0 )
{
}
See ListView..::.SelectedItems Property for more info.
EDIT: As per the MSDN documentation:
If no items are currently selected, an empty ListView..::.SelectedListViewItemCollection is returned.
So the null check is not needed in this case and you can simply do:
if( myListView.SelectedItems.Count == 0 )
{
}