ListView的平铺方式的数据,改了table里的列的内容,listview怎么不跟着显示?
Dim
lvw As WinForm.ListView =
e.Form.Controls("ListView1")
lvw.StopRedraw() '暂停绘制
lvw.View = ViewMode.Tile
'显示模式为平铺
lvw.Images.LargeSize = New
Size(65,75)
'定义大图标尺寸
lvw.TitleSize = New Size(150,90)
'设置平铺区域的大小
Dim cls() As String = {"编号","姓名","部门","职务","性别"} '定义列名
For
i
As
Integer = 0
To cls.Length - 1 '增加列
Dim
c
As
WinForm.ListViewColumn = lvw.Columns.Add()
c.Name = cls(i) '指定列名
Next
Dim Key As
String = dr("照片") 'dr数据表的当前行
lvw.Images.AddLargeImage(Key,
Key) '添加照片,直接用文件名作为图片键值
Dim vr As WinForm.ListViewRow =
lvw.Current '当前图片
vr.ToolTipText =
dr("备注") '设置此行的动态提示
vr.ImageKey = Key
'设置图片键值
For
Each cl As
String
In cls '逐列取值
vr(cl) = dr(cl) '这里有问题,表里更新了列的内容,但是vr不跟着动,重新生成是有用的,该怎么改?
Next
lvw.ResumeRedraw()