1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Dim itemfamille As New ListViewItem
For Each Fam As Famille In Famille.Get_Objets_All
For Each opt As Options In Options.Get_Objets_Filtre_Par_Famille(Fam)
itemfamille = New ListViewItem
itemfamille.Text = opt.Nom
itemfamille.ImageKey = opt.OPT_ICONE
itemfamille.Tag = opt.Numero
itemfamille.SubItems.Add(Fam.FAM_NOM)
ListView_Services.Items.Add(itemfamille)
Next
Next
'Grouper les options par famille
Dim trouve As Boolean = True
For Each lvi As ListViewItem In ListView_Services.Items
Dim groupe As String = lvi.SubItems(1).Text
For Each lvg As ListViewGroup In ListView_Services.Groups
If lvg.Name = groupe Then
lvi.Group = lvg
trouve = False
End If
Next
If trouve = True Then
Dim groupefamille As New ListViewGroup(groupe, groupe)
ListView_Services.Groups.Add(groupefamille)
lvi.Group = groupefamille
End If
trouve = True
Next |
Partager