Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 110

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Các trang trong Ví dụ 22,26 bộ lọc các nội dung của bảng cơ sở dữ liệu Thảo luận theo cột ParentID của nó. Thứ nhất, các nút cấp cao được thêm vào TreeView. Tiếp theo, các nút con là đệ quy thêm vào TreeView với sự giúp đỡ của các AddChildTreeViewNodes () phương pháp. | 1064 CHAPTER 22 Using the Navigation Controls DataView view new DataView treeViewData view.RowFilter ParentID parentTreeViewNode.Value foreach DataRowView row in view TreeNode newNode new TreeNode row Subject .ToString row MessageId .ToString parentTreeViewNode.ChildNodes.Add newNode AddChildTreeViewNodes treeViewData newNode script html xmlns http www.w3.org 1999 xhtml head id Head1 runat server style type text css style title TreeView Database title head body form id form1 runat server div asp TreeView id TreeView1 Runat server div form body html The page in Listing 22.26 filters the contents of the Discuss database table by its ParentID column. First the top-level nodes are added to the TreeView. Next the child nodes are recursively added to the TreeView with the help of the AddChildTreeViewNodes method. Using Populate On Demand and AJAX You can use the TreeView control even when working with a large set of data. For example the Microsoft MSDN website msdn.Microsoft.com has links to thousands of articles. This website uses a tree view to display the nested links to the articles. Because thousands of articles are hosted at the MSDN website not all the tree nodes are downloaded to the browser when you open a page. Instead additional nodes are downloaded to your browser only when you expand a particular node. From the Library of Wow eBook Using the TreeView Control 1065 You can use a feature named Populate On Demand with the TreeView control. When you enable the PopulateOnDemand property for a Tree node child nodes are not added to the parent node until the parent node is expanded. For example the page in Listing 22.27 contains an infinitely expanding TreeView. Each time you expand a Tree node five new child nodes display. Each time you expand a child node five more child nodes display and so on see Figure 22.20 . 22 FIGURE 22.20 An infinitely expanding TreeView control. LISTING 22.27 TreeViewPopulateOnDemand.aspx @ Page Language C DOCTYPE html PUBLIC - W3C DTD .

TÀI LIỆU LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.