codematrix
codematrix

Reputation: 1611

VB.NET WinForms ListView doesn't display column headers

I have below code in my Form Load event handler but the ListView doesn't show any column headers. I want the column headers to be displayed. Any ideas?

    lstBatch.Columns.Add("C1", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C2", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C3", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C4", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C5", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C6", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C7", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C8", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C9", 100, HorizontalAlignment.Center)
    lstBatch.Columns.Add("C10", 100, HorizontalAlignment.Center)

Upvotes: 3

Views: 7405

Answers (1)

Marco
Marco

Reputation: 57573

You should add

lstBatch.View = System.Windows.Forms.View.Details

Upvotes: 7

Related Questions