468,283 Members | 1,798 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

listview- write to specific column

Hello all,

This is my first time using listview.

I was looking in google for a way to write to a specific column. I have
3 columns in my list view.
I want to be able to write to a specific one.

Also, it seems that even when i set listview to have 3 colums, there's
a fourth one with no header. How can I remove it and have only 3
columns with with headers?

TIA.

Dec 8 '06 #1
1 2294
Hello Eran,

You are really posting to the wrong newsgroup here - this is a group for
the C# language, there are others that would be more appropriate for your
question, like *.framework.windowsforms.*. I'm just saying, as you haven't
had any replies so far.
>This is my first time using listview.

I was looking in google for a way to write to a specific column. I have
3 columns in my list view.
I want to be able to write to a specific one.
The values for all columns apart from the first one are read from the
SubItems property of each ListViewItem. So to see anything at all in a
given row, you'll have to add a ListViewItem to the Items property of the
list view, then add one or more instances of ListViewSubItem to the
SubItems property of the ListViewItem.
>Also, it seems that even when i set listview to have 3 colums, there's
a fourth one with no header. How can I remove it and have only 3
columns with with headers?
I assume what you mean is actually the remaining horizontal space that is
not currently taken up by the existing columns. Some 3rd party grid
controls have the ability of automatically resizing the columns to take up
any free space there may be, but I don't think the standard ListView
control has that feature. I may be mistaken, because I don't use it that
often.
Of course you could implement the feature yourself, listening to the
relevant resize events and recalculating the width of the columns so that
there's no remaining space.
Oliver Sturm
--
http://www.sturmnet.org/blog
Dec 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Anushya | last post: by
reply views Thread by Anushya | last post: by
reply views Thread by keith | last post: by
7 posts views Thread by Dave Y | last post: by
4 posts views Thread by firefox | last post: by
4 posts views Thread by Brian Gaze | last post: by
1 post views Thread by =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.