Making ListViewItems not selectable

  • Thread starter Thread starter Johnny Jörgensen
  • Start date Start date
J

Johnny Jörgensen

I've got a lot of items I for some reasons want to present in a Listview
control. I want the users to be able to check the items using the
checkboxes, but I do NOT want the listview to show the item as selected when
the user clicks it.

Does anybody know of a way of preventing that?

Cheers,
Johnny J.
 
I've got a lot of items I for some reasons want to present in a Listview
control. I want the users to be able to check the items using the
checkboxes, but I do NOT want the listview to show the item as selected when
the user clicks it.

Does anybody know of a way of preventing that?

Cheers,
Johnny J.

I don't know if this will cause the selection bar to flash or not, but
you could set the selectedindex to -1 on the selectedindexchanged
event.

Thanks,

Seth Rowe
 
ListViews don't have a selectindex property, but I tried setting multiselect
to false and MyListView.SelectedItems(0).Selected = false in the
selectedindexchanged event.

I hadn't tried that, because actually I was sure that it was going to
flicker - But it didn't, strangely enough, so now the problem is solved.
Thanks...

Cheers,
Johnny


I've got a lot of items I for some reasons want to present in a Listview
control. I want the users to be able to check the items using the
checkboxes, but I do NOT want the listview to show the item as selected
when
the user clicks it.

Does anybody know of a way of preventing that?

Cheers,
Johnny J.

I don't know if this will cause the selection bar to flash or not, but
you could set the selectedindex to -1 on the selectedindexchanged
event.

Thanks,

Seth Rowe
 
ListViews don't have a selectindex property, but I tried setting multiselect
to false and MyListView.SelectedItems(0).Selected = false in the
selectedindexchanged event.

I hadn't tried that, because actually I was sure that it was going to
flicker - But it didn't, strangely enough, so now the problem is solved.
Thanks...

Cheers,
Johnny






I don't know if this will cause the selection bar to flash or not, but
you could set the selectedindex to -1 on the selectedindexchanged
event.

Thanks,

Seth Rowe

ListViews don't have a selectindex property, but I tried setting multiselect
to false and MyListView.SelectedItems(0).Selected = false in the
selectedindexchanged event.

Oops - I was thinking ListBox - this was a precoffee response.

:-)
I hadn't tried that, because actually I was sure that it was going to
flicker - But it didn't, strangely enough, so now the problem is solved.

Hey - I tell you the wrong thing and it still helps solve the problem
- am I good or what?

Thanks,

Seth Rowe
 
Back
Top