以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]请问下代码生成目录树怎么排序 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=187159) |
||||||||||
-- 作者:忆似水流年 -- 发布时间:2023/6/27 14:35:00 -- [求助]请问下代码生成目录树怎么排序 想要降序排 大的号码在第一行 先谢谢啦:D Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree(gt, "Job|Serviceitem") trv.StopRedraw For Each nd As WinForm.TreeNode In trv.AllNodes Dim fl1 As String = nd.DataRow("Job") Dim fl2 As String = nd.DataRow("Serviceitem") Select Case nd.Level Case 0 nd.Text = nd.text & "(" & gt.Compute("Sum(行数)", "Job=\'" & fl1 & "\'") & "条)" Case 1 nd.Text = nd.text & "(" & gt.Compute("Sum(行数)", "Job=\'" & fl1 & "\' and Serviceitem=\'" & fl2 & "\'") & "条)" End Select Next trv.Nodes.Insert("[显示所有行]", "[显示所有行(" & Val(gt.Compute("Sum(行数)")) & "条)]", 0) trv.ResumeRedraw |
||||||||||
-- 作者:有点蓝 -- 发布时间:2023/6/27 14:41:00 -- trv.BuildTree(gt, "Job|Serviceitem","","Job desc") BuildTree 根据指定的数据表内容生成目录树节点。 BuildTree(DataTableName, Columns, Filter, Sort) 或 BuildTree(DataTable, Columns, Filter, Sort)
|