473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Making ListViewItems not selectable

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
3 4318
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul | last post by:
Hello, I am trying to make a menu for a html page and I am using DIV tags for buttons. I don't like the idea of being able to select the text, is there a way I can change this behaviour to make...
2
by: Rachel Suddeth | last post by:
Is there a way to have the non-selectable dates (those before MinDate and after MaxDate) draw differently so my users can see right away what dates aren't allowed? I'm not seeing it... ...
5
by: Samuel | last post by:
Hi, I am running into a problem of mixing UICulture = auto and allowing users to select culture using a dropdown list. I am detecting a querystring, "setlang", and when found, setting the...
8
by: Chad Miller | last post by:
lvProjects.Clear() lvProjects.View = View.Details lvProjects.FullRowSelect = True lvProjects.Columns.Add("Id", 50, HorizontalAlignment.Left) lvProjects.Columns.Add("Name", -1,...
2
by: polocar | last post by:
Hello, I'm developing a C# program using Visual Studio 2005 Professional Edition. In the main form I have inserted a ListView control that is populated in a different way depending on the item...
1
by: Homer | last post by:
Hi, I used a template for my first Web application. I made a few changes to the layer thru its css file. The problem that has been vexing me is the vertical spacing for each navigation menu...
3
by: Thomas Pajor | last post by:
Hey everybody, I got into serious trouble with template programming. I have a class which uses three template arguments, say template<typename Atype, typename Btype, typename Ctype> class...
1
by: dbphoto | last post by:
I've created a selectable layer and inputted the action script into the button but the layer appears on the main layer and is not selectable. Any ideas?
1
by: =?Utf-8?B?VmljdG9y?= | last post by:
Hi, How to get a list of ListViewItems that are currently shown in a Windows Form ListView control when that that control is in a virtual mode?
2
by: DMVC | last post by:
Hi all. I've built a class based on "Control" and I want this object of mine to be selectable. I believe that, by default, Control is non-selectable so I used ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.