职工一览表,有姓名,性别,照片列。现在想用LISTview 窗口只显示男同志姓名及照片
使用Tables("职工一览表").Filter = "[性别] = '男'"好像不行,结果还是显示的全部照片。
请问对如下代码如何修改:
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.StopRedraw()
lvw.Rows.Clear()
lvw.Images.Clear()
lvw.View = ViewMode.LargeIcon
lvw.Images.LargeSize = New Size(78,98)
'For Each dr As DataRow In DataTables("职工一览表").DataRows '
For Each dr As DataRow In DataTables("职工一览表").Select("","_SORTKEY")
Dim Key As String = dr("照片")
lvw.Images.AddLargeImage(Key, Key)
Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
vr.Text = dr("姓名")
vr.ImageKey = Key
Next
lvw.ResumeRedraw()