此主题相关图片如下:qq截图20151122110051.png
我想编辑数据后保存再点左下角的刷新重新加载树,好像没反应,不知道哪里写的不对,老师们帮看看
'''
Dim cb1 As WinForm.CheckBox = e.Form.Controls("显示筛选树")
Dim tb As WinForm.Table = e.Form.Controls("Table1")
'If cb1.Checked And tb.Table.Rows.Count =1 Then
'首先生成统计表
If DataTables.Contains("统计表_调车流水") Then
DataTables.Unload("统计表_调车流水")
End If
Dim dt As DataTable
Dim g As New GroupTableBuilder("统计表_调车流水", DataTables("业务_调车流水"))
g.Groups.AddDef("sys_统计月", DateGroupEnum.Year, "年")
g.Groups.AddDef("sys_统计月", "月")
g.Groups.AddDef("车号")
g.Totals.AddDef("计费时间", "本月小计", "小计")
dt = g.Build(False) '参数设置为False,生成一个临时表,不在主界面显示
'然后根据统计表生成目录树
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt, "年|月|车号")
trv.StopRedraw
For Each nd As WinForm.TreeNode In trv.AllNodes
Select Case nd.Level
Case 0
nd.Text = nd.text & "年"
Case 1
nd.Text = nd.text & "月"
Case 2
nd.Text = nd.text & "(" & nd.DataRow("本月小计") & "小时)"
End Select
Next
trv.Nodes.Insert("显示所有行","显示所有行",0)
trv.ResumeRedraw
'End If
[此贴子已经被作者于2015/11/22 11:38:05编辑过]