prepareEdit事件
static flag As Boolean = False
If e.Col.name = "地区" Then
If e.IsFocusCell And flag = False Then
Dim tb As New DropTreeBuilder
tb.SourceTable = DataTables("表B") '指定目录树表
tb.TreeCols = "地区" '指定用于生成目录树的列
tb.ReceiveCols = "地区" '指定数据接收列
Dim fdr As DataRow = DataTables("表B").find("国家='" & e.Row("国家") & "'")
If fdr IsNot Nothing Then
Dim dq As Integer = e.Table.DataTable.Compute("max(地区)", "国家='" & e.Row("国家") & "' and _Identify <> " & e.Row("_Identify"))
tb.TreeFilter = "国家='" & e.Row("国家") & "' and 地区 > " & dq
Else
Dim dq As Integer = e.Table.DataTable.Compute("max(地区)", "国家='其他' and _Identify <> " & e.Row("_Identify"))
tb.TreeFilter = "国家='其他' and 地区 > " & dq
End If
e.Col.DropTree = tb.Build()
flag = True
End If
Else
flag = False
End If