Rumah >pembangunan bahagian belakang >Tutorial C#.Net >devexpress TreeList递归的实例代码
XtraUserControlBlankList_Load(= = = = = ;= = = = = = = = .BlankTreeList.Columns.AddRange( [] {,}, TreeListNode node = .BlankTreeList.FindNodeByFieldValue(, ); == = (dt.Rows.Count > (DataRowView dv1 [] nodeview = { dv1[], dv1[], dv1[=].ToString(),dt,tn);
private void GetChild(string upnode, DataTable dt,TreeListNode tn) {try{ DataView dv = new DataView(dt); dv.RowFilter = "ParentId = '" + upnode + "'";foreach (DataRowView dv1 in dv) {object[] nodeview = { dv1["BlankID"], dv1["BlankName"], dv1["ParentId"] }; TreeListNode childnode = BlankTreeList.AppendNode( nodeview , tn); GetChild(dv1["BlankID"].ToString(), dt, childnode);//参数(父级ID,DataTable表,父节点) } }catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void BlankTreeList_FocusedNodeChanged_1(object sender, FocusedNodeChangedEventArgs e) { TreeListNode curNode = e.Node;if (curNode == null) return; TxtE1.Text = curNode.GetValue("BlankID").ToString();}
Atas ialah kandungan terperinci devexpress TreeList递归的实例代码. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!