Devexpress 12.2.8.0 部分学习笔记1 【ASPxTreeView】

树视图

  下面是图片和代码的形式简单的描述了怎么绑定数据库

  

1 treeList.DataSource = AccessDataSource1;
2 treeList.KeyFieldName = "ID";
3 treeList.ParentFieldName = "ParentID";
4 treeList.DataBind();

-----非绑定模式

  

 1 using DevExpress.Web.ASPxTreeList;
 2 
 3 protected void Page_Load(object sender, EventArgs e) {
 4     CreateTree();
 5 }
 6 
 7 void CreateTree() {
 8     TreeListNode parentNode = CreateNodeCore(0, "<b>Local Folders</b>", null);
 9     CreateNodeCore(1, "Inbox", parentNode);
10     CreateNodeCore(2, "Outbox", parentNode);
11     CreateNodeCore(3, "Sent Items", parentNode);
12     CreateNodeCore(4, "Deleted Items", parentNode);
13     TreeListNode searchFolders = CreateNodeCore(5, "<b>Search Folders</b>", null);
14     CreateNodeCore(6, "Categorized Mail", searchFolders);
15     CreateNodeCore(7, "Large Mail", searchFolders);
16 }
17 
18 TreeListNode CreateNodeCore(int key, string text, TreeListNode parentNode) {
19     TreeListNode node = ASPxTreeList1.AppendNode(key, parentNode);
20     node["Folder"] = text;
21     return node;
22 }
1 <dxwtl:ASPxTreeList ID="ASPxTreeList1" runat="server" AutoGenerateColumns="False"
2     Width="300px">
3     <Columns>
4         <dxwtl:TreeListTextColumn FieldName="Folder" VisibleIndex="0">
5             <PropertiesTextEdit EncodeHtml="False">
6             </PropertiesTextEdit>
7         </dxwtl:TreeListTextColumn>
8     </Columns>
9 </dxwtl:ASPxTreeList>

 

 

先止于此~!

转载于:https://www.cnblogs.com/hrx-star/archive/2013/06/11/3131667.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值