List View header is missing

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Hello everybody,

For the first time I'm working with the List View in C#. Obviously
I've started with the header initialization.

ColumnHeader colHead = new ColumnHeader();

colHead .Text = "Title";
colHead .Text = "Category";
colHead .Text = "Rating";

this.listInfo.Columns.Add(colHead);

I didn't fill control yet. When I run my form based application list
view header is missing. What I do wrong?

Thanks,
Alex
 
For the first time I'm working with the List View in C#. Obviously
I've started with the header initialization.

ColumnHeader colHead = new ColumnHeader();

colHead .Text = "Title";
colHead .Text = "Category";
colHead .Text = "Rating";

this.listInfo.Columns.Add(colHead);

I didn't fill control yet. When I run my form based application list
view header is missing. What I do wrong?

You failed to set the view mode to Details (or Report, as it was called in
ye olden days).
 
I just noticed: is this your real code? If so, you're setting the Text
property of the same column three times, and only the third time will take.
In other words, if you thought you were creating three columns, you're not;
you're creating one: Rating.
 
Back
Top