Foxtable(狐表)用户栏目专家坐堂 → 目录树 周显示


  共有2870人关注过本帖树形打印复制链接

主题:目录树 周显示

帅哥哟,离线,有人找我吗?
manyifuwu
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:500 积分:5409 威望:0 精华:0 注册:2009/2/5 13:09:00
目录树 周显示  发帖心情 Post By:2021/4/9 17:47:00 [显示全部帖子]

1、窗口的AfterLoad事件代码改为:

Dim cmd As New S
Dim
dt As DataTable
cmd
.CommandText = "SEL  ECT DIST  INCT Year(日期) As , Month(日期) As , 产品 From {订单}"
dt
= cmd.ExecuteReader()
Dim
trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv
.BuildTree(dt, "年|月|产品")

2、目录树的NodeMouseDoubleClick事件代码改为:

Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
Dim
Filter As String
Dim
Year As Integer = dr("年")
Dim
Month As Integer = dr("")
Dim
Product As String = dr("产品")
Select Case
e.Node.Level
    Case
0
       
Filter ="Year(日期) = " & Year
    Case
1
       
Filter ="Year(日期) = " & Year & " And Month(日期) = " & Month
    Case
2
       
Filter ="Year(日期) = " & Year & " And Month(日期) = " & Month & " And 产品 = '" & Product & "'"
End Select
DataTables(
"订单").LoadFilter = Filter
DataTables(
"订单").Load()

 

以上是实现  年|月|产品的加载树。

如何实现,   年|月|周


 回到顶部