Search code examples
vb.netdynamiccolumnheader

Adding column headers to listview dynamically


I have a list view that I want to add column headers to dynamically.

    For i = 1 To MaxMatches
        Tempstring = "Match " & i.ToString
        ScheduleListView1.Columns.Add(New ColumnHeader() Tempstring)
    Next

The hover tip seems to indicate I can do this (I would post a picture of it, but my reputation isn't there yet).

But it doesn't like the syntax.

Thanks for the help in advance


Solution

  • This probably should work better:

    ScheduleListView1.Columns.Add(Tempstring)