日期:2014-05-18 浏览次数:20404 次
//加载节点 Dim tmpTreeNode As TreeNode For i = 0 To dteCatalogInfo.Rows.Count - 1 tmpTreeNode = New TreeNode(dteCatalogInfo.Rows(i).Item(MATERIALINFO_DEFINE.MATERIAL_INFO_Name_FIELD).ToString) tmpTreeNode.Value = "00" & dteCatalogInfo.Rows(i).Item(MATERIALINFO_DEFINE.MATERIAL_INFO_ID_FIELD).ToString & "|" & dteCatalogInfo.Rows(i).Item(MATERIALINFO_DEFINE.MATERIAL_INFO_ID_FIELD).ToString tmpTreeNode.ImageUrl = "Img/book.gif" tmpTreeNode.NavigateUrl = "#&menuNodeID=" & dteCatalogInfo.Rows(i).Item(MATERIALINFO_DEFINE.MATERIAL_INFO_ID_FIELD).ToString tmpTreeNode.Expanded = True TreeView1.Nodes.Add(tmpTreeNode) SetNodeText(TreeView1.Nodes(TreeView1.Nodes.IndexOf(tmpTreeNode))) Next i Protected Sub SetNodeText(ByRef node As TreeNode) Dim id As String id = "spnode_" + node.Value node.Text = "<span style='cursor:hand' id='" + id + "' onclick=""SetNode('" + id + "','" + node.NavigateUrl + "','" + node.ValuePath + "')"" oncontextmenu=""SetNode('" + id + "','" + node.NavigateUrl + "','" + node.ValuePath + "') "">" + node.Text + "</span>" End Sub
------解决方案--------------------
楼上解..............