By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,626 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,626 IT Pros & Developers. It's quick & easy.

Making ListViewItems not selectable

P: n/a
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.
Jul 5 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Jul 5, 7:55 am, "Johnny Jörgensen" <j...@altcom.sewrote:
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

Jul 5 '07 #2

P: n/a
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
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11*********************@n2g2000hse.googlegrou ps.com...
On Jul 5, 7:55 am, "Johnny Jörgensen" <j...@altcom.sewrote:
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
Jul 5 '07 #3

P: n/a
On Jul 5, 8:17 am, "Johnny Jörgensen" <j...@altcom.sewrote:
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

"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message

news:11*********************@n2g2000hse.googlegrou ps.com...
On Jul 5, 7:55 am, "Johnny Jörgensen" <j...@altcom.sewrote:
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.
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

Jul 5 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.