Making ListViewItems not selectable

  • Thread starter Johnny Jörgensen
  • 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.
 
R

rowe_newsgroups

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
 
J

Johnny Jörgensen

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
 
R

rowe_newsgroups

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top