Define "read-only." List views are by default 100% read-only in that you
can't change their values (LabelEdit is false). Are you perhaps talking
about resizing?
Although I agree that the data should not be editable in a ListView cell, I
am finding that if I treble click in the first column I am able to edit the
text. The cell text becomes surrounded by square brackets, e.g. [My Text],
and I am therefore able to edit the text.
I already handle the double click, but it seems the third click makes the
cell editable.
Although I agree that the data should not be editable in a ListView cell,
I am finding that if I treble click in the first column I am able to edit
the text. The cell text becomes surrounded by square brackets, e.g. [My
Text], and I am therefore able to edit the text.
I already handle the double click, but it seems the third click makes the
cell editable.
You've got something else going on. Is this a plain vanilla list view?
Select it in Design view in Visual Studio and then look at the Properties
window. In the dropdown at the top you'll see the name of the control (in
bold) followed by the class name. (You may have to increase the width of the
Properties window to see the full name.) Is it
"System.Windows.Forms.ListView"?
I put a regular list view on a form, added three items to it, and it never
exhibited the behavior you described. I tried several different views, too
(Details, List, etc.).
The first column is editable unless you set "LabelEdit" false in Properties.
The other columns are always read only. Just go to Properties and set
"LabelEdit" false and you will have what you want.
The first column is editable unless you set "LabelEdit" false in
Properties.
The other columns are always read only. Just go to Properties and set
"LabelEdit" false and you will have what you want.
In .NET 2.0 (at least), LabelEdit is false by default, so there should be no
need to set it to false unless you previously set it to true.
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.