A表如下:
序号
[_Identify] 姓名
1
4 张三
2
5 李四
3
1 王五
4
3 徐六
5
2 费七
对以上表,用文档模板形成的文档都是按序号来的.
但用窗口设计的LISTVIEW就不行,排序是按_Identify 来的,LISTVIEW 的窗口Afterload代码如下,请问:如何修改,将窗口显示的顺序也是按序号来的?谢谢!
Dim lvw As WinForm.ListView =
e.Form.Controls("ListView1")
lvw.View = ViewMode.Details
Dim cls() As String = {"序号","姓名"}
Dim wds() As String = {80,80}
For i As Integer = 0 To cls.Length - 1
Dim c As WinForm.ListViewColumn = lvw.Columns.Add()
c.Text = cls(i) '
c.Name = cls(i) '
c.Width = wds(i)
Next
For Each dr As DataRow In
DataTables("A表").DataRows
Dim vr As WinForm.ListViewRow = lvw.Rows.Add()
For
Each cl As String In cls
vr(cl) = dr(cl)
Next
vr.Tag= dr
Next
lvw.ResumeRedraw()