Microsoft.Web.ui.WebControls.treeView recursive generating tree

xiaoxiao2021-03-06  86

///

/// Establish menu function tree /// /// Contains the view of all records of the menu table /// Tree node Collection, incoming mytv.nodes, /// superior menu ID public static void createmenutree (DataView MyDV, TreenodeCollection TNC, String ClassParentID ) {try {DataView dataView = new DataView (); dataView = myDv.Table.Copy () DefaultView;. dataView.RowFilter = "ownerid =" classParentID ""; foreach (DataRowView drv in dataView) {if (UserRight. Getisshow (DRV ["MenuValue"]. TOSTRING (), DRV ["Right"]. ToString (), DRV ["Menuid"]. TREENODE TN = New Treenode (); tn.id = DRV ["Menuid"]. Tnowtring (); tn.text = "" DRV ["MENUNAME "] .Tostring (). Trim () " "; tn.imageURL = DRV [" imgurl "]. Tostring (); tn.navigateURL = DRV [" Menuhref "]. Tostring () ==" "?" ": DRV [" Menuhref "]. TOSTRING () "? menuid = " DRV ["Menuid"]. Tnowtring (); tn.target = "mainframe"; TNC.Add (TN); CreateMenutree (MYDV, TN.NODES, TN.ID);}}} catch (Exception EX) {Hansheen.eOffice_ora .Components.error.log ("Get Tree Error:" EX.MESSAGE);}} Call instance: protected Microsoft.Web.ui.WebControls.treeView TVMenu ;. . . . .

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

New Post(0)