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>

 

 

先止于此~!

posted @ 2013-06-11 11:53  南修子  阅读(530)  评论(0编辑  收藏  举报