以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 窗口排序请教 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=67240) |
-- 作者:HJG_HB950207 -- 发布时间:2015/4/20 18:43:00 -- 窗口排序请教 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() |
-- 作者:有点酸 -- 发布时间:2015/4/20 20:26:00 -- For Each dr As DataRow In DataTables("A表").DataRows
改为:
For Each dr As DataRow In DataTables("A表").Select("","排序列名称")
参考: http://www.foxtable.com/help/topics/0400.htm
|
-- 作者:HJG_HB950207 -- 发布时间:2015/4/20 20:33:00 -- 谢谢 |