如题,设置初始不加载表,打开项目后,点击数据加载窗口的按钮,加载表,加载完成后,有个别业务窗口列名不显示,行里的内容也不显示
但是可以见到行号,可以点选内容。
此主题相关图片如下:1.png
窗口的afterload事件代码如下:(请老师忙看下有没有不正确的地方)
curTable = e.Form.Controls("Table1").Table
Dim filter As String
'生成目录树
'首先生成统计表
Dim dt As DataTable
Dim b As New sqlGroupTableBuilder("total","Person")
b.C
b.Filter = filter
b.groups.adddef("PeVillage")
b.Groups.AddDef("PeGroup")
b.Totals.AddDef("PeName",AggregateEnum.Count,"peoples") '根据客户列来统计记录数,也就是订单数
dt = b.Build '参数设置为False,生成一个临时表,不在主界面显示
'然后根据统计表生成目录树
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt,"PeVillage|PeGroup")
trv.StopRedraw
For Each nd As WinForm.TreeNode In trv.AllNodes
Dim cj As String = nd.DataRow("PeVillage")
Dim z As String = nd.DataRow("PeGroup")
Select Case nd.Level
Case 0
nd.Text = nd.text & "(" & dt.Compute("Sum(peoples)"," PeVillage = '" & cj & "'") & "人)"
Case 1
nd.Text = nd.text & "(" & dt.Compute("Sum(peoples)"," PeVillage = '" & cj & "' And PeGroup = '" & z & "'") & "人)"
End Select
Next
trv.Nodes.Insert("全部人员","全部人员(" & dt.Compute("Sum(peoples)") & "人)",0)
trv.ResumeRedraw
'不加载数据
curTable.filter = " [_identify] Is null "
'列宽及显示
Functions.Execute("colSetup",curTable)
'锁定表
curTable.AllowEdit = False
2.请教大家,动态加载表时,窗口中表的类型用默认类型就可以了是吗?