节点里有个属性叫Tag的,这个就是绑定数据的。
StringBuilder sql2 = new StringBuilder();
sql2.AppendLine("select t1.gUIID,t1.cCaption,t1.cUICode");
sql2.AppendLine(" from DEV_MenuItems t0");
sql2.AppendLine(" join UA_ListUI t1 on t1.gUIID=t0.gSolID");
sql2.AppendLine(" where gMEID='" + nRvMU["gMEID"] + "'");
sql2.AppendLine(" order by cUICode");
fListUIsDt = DBDataHelper.DevQuery(sql2.ToString());
fListUIsDv = fListUIsDt.DefaultView;
foreach (DataRowView nRvUI in fListUIsDv)
{
TreeNode Node2 = new TreeNode();
Node2.Tag = nRvUI;
Node2.Text = nRvUI["cCaption"].ToString();
Node2.Checked = this.CheckUI((Guid)(nRvRO["gROID"]), (Guid)(nRvUI["gUIID"]));
Node1.Nodes.Add(Node2);
}