Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement Recursive binding data of TreeList in Devexpress Control

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to achieve TreeList recursive binding data in the Devexpress control, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

The TreeList control in Devexpress can achieve functions similar to TreeView.

TreeList recursively binds data in DataTable

Two watches. The first table is the parent node type, and the second table is the child node under each type.

Public void Bind () {this.TreeList.Clear (); DataTable dt= "query collections from the database"; if (dt.Rows.Count > 0) {TreeListNode node=treelist1.AppendNode ("id", NULL); node.SetValue= (0, "Name"); for (int itransitiondt.Rows.Countpolitics +) {TreeListNode nodeTemp=treelist1.AppendNode (dt.Rows [I] ["ID"], node); nodeTemp.SetValue (TreeListClomus1,dt.Rows [I] ["Name"]); nodeTemp.Tag=dt.Rows [I] GetChildNode (TreeListNode node, dt.Rows [I] ["ID"]);} public void GetChildNode (TreeListNode node, string parent) {DataTable dt= "query where id= from the database" + parent; if (dt.Rows.Count >) {for (int iDeposit I)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report