G
Guest
Hello
I've added a listview to my WinForms C# 2.0 application. The listview is
displayed in Details view and has the FullRowSelect property set to true. I'm
using the listview control like a multi column list box (with column
headers), and I've set the MultiSelect property to false. It all works fine
apart from the user can unselect the selected listviewitem by clicking in a
blank area of the listview.
I could add some code in the SelectedIndexChanged event to check if all the
items are unselected and select the previously selected item, but this causes
the listview to flicker. There must be a better way.
How can I make sure the ListView always has a selected lsitviewitem?
Thank you for your help.
I've added a listview to my WinForms C# 2.0 application. The listview is
displayed in Details view and has the FullRowSelect property set to true. I'm
using the listview control like a multi column list box (with column
headers), and I've set the MultiSelect property to false. It all works fine
apart from the user can unselect the selected listviewitem by clicking in a
blank area of the listview.
I could add some code in the SelectedIndexChanged event to check if all the
items are unselected and select the previously selected item, but this causes
the listview to flicker. There must be a better way.
How can I make sure the ListView always has a selected lsitviewitem?
Thank you for your help.