参考
If e.DataCol.Name = "上级_编号" Then Dim pdr As DataRow = e.DataTable.Find("编号 = '" & e.DataRow("上级_编号") & "'") Dim str As String = "" Do While pdr IsNot Nothing str = "/" & pdr("编号") & str pdr = e.DataTable.Find("编号 = '" & pdr("上级_编号") & "'") Loop e.DataRow("绝对路径") = str & "/" & e.DataRow("编号")End If