Mám problém zobrazit v projekte ListView.Goups Preco mi nechce zobrazit skupiny? Tu je skusobny zdrojak:
Private Sub FillLV()
ListView1.Items.Clear()
ListView1.Groups.Clear()
Dim item0 As New ListViewItem(New String() _
{"Programming Windows", "Petzold, Charles", "1998"})
Dim item1 As New ListViewItem(New String() _
{"Code: The Hidden Language of Computer Hardware and Software", "Petzold, Charles", "2000"})
Dim item2 As New ListViewItem(New String() _
{"Programming Windows with C#", "Petzold, Charles", "2001"})
Dim item3 As New ListViewItem(New String() _
{"Coding Techniques for Microsoft Visual Basic .NET", "Connell, John", "2001"})
Dim item4 As New ListViewItem(New String() _
{"C# for Java Developers", "Jones, Allen / Freeman, Adam", "2002"})
Dim item5 As New ListViewItem(New String() _
{"Microsoft .NET XML Web Services Step by Step", "Jones, Allen / Freeman, Adam", "2002"})
Dim gr As ListViewGroup
'vytvorenie skupiny
gr = New ListViewGroup("Skupina A", HorizontalAlignment.Left)
ListView1.Groups.Add(gr) 'pridanie skupiny A
item0.Group = gr 'priradenie skupiny
ListView1.Items.Add(item0) 'pridanie polozky 0
item1.Group = gr 'priradenie skupiny
ListView1.Items.Add(item1) 'pridanie polozky 1
item2.Group = gr 'priradenie skupiny
ListView1.Items.Add(item2) 'pridanie polozky 2
'dalsia skupina
gr = New ListViewGroup("Skupina B", HorizontalAlignment.Left)
ListView1.Groups.Add(gr) 'pridanie skupiny B
item3.Group = gr 'priradenie skupiny
ListView1.Items.Add(item3) 'pridanie polozky 3
item4.Group = gr 'priradenie skupiny
ListView1.Items.Add(item4) 'pridanie polozky 4
'dalsia skupina
gr = New ListViewGroup("Skupina C", HorizontalAlignment.Left)
ListView1.Groups.Add(gr) 'pridanie skupiny C
item5.Group = gr 'priradenie skupiny
ListView1.Items.Add(item5) 'pridanie polozky 5
End Sub
Sub VypisSkupiny()
Debug.Print("-------Vypisujem skupiny-------")
Dim i As Integer
For i = 0 To Me.ListView1.Groups.Count - 1
Debug.Print(Me.ListView1.Groups(i).ToString)
Next
End Sub
V novom vytvorenom projekte mam tento isty formular a tam skupiny zobrazi. Viete mi niekto poradit? Vobec netusim kde moze byt problem. Uz som nad tym stravil niekolko hodin a som zufaly. Nepouzivam nic nestandardne
|