Hi all,

Could someone please explain me why "Listview.Selected" alway retuns a value?

After I upload data into list view, system will highlight first line in list veiew. Although I dehighlight it and my UI will not see any selected item, but my softwre always get "return value = 1" when using If lvData.SelectedItem Is Nothing Then Exit Sub

If user selected 3 lines and my software dehighlights them, the checking will get "return value = 3". So, how should I do the checking for selected items? (or)
Should I need to check individual line by line?

Best regards,
Zawpai

Recommended Answers

All 2 Replies

If lvData.SelectedItems.Count < 1 Then Exit Sub

Hi Unim portant,

That way is not corrected becuase "listview" has already had data (Eg: 100 lines). So, the return value always 100 no matter whether you have done multiple highlight or dehightlight.

Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.