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

listview- write to specific column

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.