Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.Groups.Clear() '清除原来的分组
lvw.Rows.Clear() '清除原来的行
lvw.Images.Clear() '清除原来的图片
lvw.View = ViewMode.SmallIcon
lvw.Images.AddImage("Xm", "log.ico","log.ico")'添加代表项目的图标
Dim fenzu As List(of String)= DataTable("项目登记").GetValues("省市","","省市")
For Each fz As String In fenzu
If fenzu.IndexOf(fz) <> -1 Then
Dim vg As WinForm.ListViewGroup = lvw.Groups.add()
vg.Name= fz
vg.text= fz
Dim DanJ As List(of String)= DataTable("项目登记").GetValues("项目名称","省市 ='" & fz & "'","项目名称")
For Each dj As String In DanJ
If Danj.IndexOf(dj) <> -1 Then
Dim r As WinForm.ListViewRow = lvw.Rows.add()
r.Name =dj
r.Text=dj
r.Group=fz
r.ImageKey = "Xm" '
'显示模式切换为小图标,图标能显示在左侧
End If
Next
End If
Next