Dim tb As String="XXX_Table1"
Dim AllowRemoveRight As Boolean=True '是否允许移动
If Tables(tb).GridTreeVisible Then
Dim cr As Row = Tables(tb).Current
Select Case cr.Hierarchy
Case 2 '当前行为第三层,不允许右移
AllowRemoveRight = False
Case 1
If cr.HasChild '当前行为第二层,但有子行,不允许右移
AllowRemoveRight = False
End If
Case 0 '当前行为第一层,但有子行位于第三层,不允许右移
Dim rs As List(of Row) = cr.GetChildren()
For Each r As Row In rs
If r.HasChild Then
AllowRemoveRight = False
End If
Next
End Select
End If
If AllowRemoveRight
Syscmd.GridTree.MoveRight()
End If