Dynamic generation of Microsoft, Web Control Tree (TreeView).

xiaoxiao2021-03-06  98

Public void bindtree (int parentid, microsoft.web.ui.webcontrols.treenode pnode) ?? {??? dataset ds = super.getds ("SELECT * HR_STUDY_DIR"); ??? DataView DVTree = New DataView (DS. Tables [0]); ??? // Filter ParentID to get all the current child nodes ??? Dvtree.rowFilter =? "[ParentID] =" ParentID;???

??? Foreach (DATAROWVIEW ROW IN DVTREE) ??? {???? Microsoft.Web.ui.WebControls.treenode Node = new Microsoft.Web.ui.WebControls.treenode (); ???? ing (pnode = = NULL) ???? {??? // Add root node ???? node.target = row ["hrid"]. TOSTRING (); ????? node.text = row ["DIRNAME" ] .ToString () "??????????????" "N" "????????????" "M" "???? ???????? " " d "; ????? TV.nodes.add (node); ????? node.expanded = true; // Initialization, whether all of the root node is listed Child node ????? bindtree (INT32.PARS (Row ["hrid"]. TOSTRING ()), Node); ??? // recursive again ????} ???? Else ???? { ?? // Add the child node of the current node ????? node.target = row ["hrid"]. ToString (); ????? node.text = row ["DIRNAME"]. Tostring () "?????????????" "n" "????????????" "M" "?????????? ?? " " d "; ????? pnode.nodes.add (node);

????? node.expanded = true; // Whether all child nodes of the child node are listed when the child node is listed ???? bindtree (INT32.PARSE); TOSTRING ()), NODE ???? // recursive again ????} ???} ???????????????????}

转载请注明原文地址:https://www.9cbs.com/read-123596.html

New Post(0)