Listview column Header not displaying VB.Net

后端 未结 2 908
抹茶落季
抹茶落季 2021-01-19 05:28

I am not getting column Header in listView. only one item(0) is displaying not the sub Item. here is my code. tell me what is wrong in it. Thank you in advance.

<         


        
相关标签:
2条回答
  • 2021-01-19 06:06

    You already have the objects. Just pass them in:

       With lvwPatTests
            .CheckBoxes = True
            .GridLines = True
            .FullRowSelect = True
            .HideSelection = False
            .MultiSelect = False
            .Columns.Add(header1)
            .Columns.Add(header2)
        End With
    
    0 讨论(0)
  • 2021-01-19 06:25

    You need to change your ListView control's View property to Details in order to see the columns and subitems:

    With lvwPatTests
      .View = View.Details
    
      .CheckBoxes = True
      .GridLines = True
      .FullRowSelect = True
      .HideSelection = False
      .MultiSelect = False
      .Columns.Add("Test")
      .Columns.Add("Price")
    End With
    
    0 讨论(0)
提交回复
热议问题