datacolchanged事件
If e.DataCol.Name = "阶级" Then
If e.NewValue = 1 AndAlso e.DataTable.Compute("count(阶级)","阶级=1") = 27 Then
e.DataTable.ReplaceFor("第七列",2,"阶级=1")
Dim str As String = e.DataTable.GetComboListString("上级编号","阶级=1 and 上级编号 is not null")
e.DataTable.ReplaceFor("阶级",2,"阶级=1")
Dim idx As Integer = 3
Do While str > ""
e.DataTable.ReplaceFor("第七列",idx,"本级编号 in (" & str.Replace("|",",") & ")")
str = e.DataTable.GetComboListString("上级编号","第七列=" & idx & " And 上级编号 Is not null")
e.DataTable.ReplaceFor("阶级",idx,"第七列=" & idx)
idx += 1
Loop
e.DataTable.ReplaceFor("第七列",Nothing)
End If
End If