Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

TreeList / First Look

Configure RadTreeList


Change grid lines:


Category IDProductPriceIn stockParent Category ID
123
Page size:
select
A Appetizers   
  A1 Southwestern Twisted Chips (150 gr.) $6.79A
  A2 Top Shelf Combo Appetizer (300 gr.) $9.49A
B Beverages   
  B1 Sangria (90 ml.) $6.49B

  • RadTreeList is a hybrid control combining treeview and grid in one. It gives you the opportunity for hierarchical representation of the underlying data like in a treeview. In addition it can have multiple columns and provides you with the ability to perform advanced operations.

    The key features of the RadTreelist control are:

    • Various column types
    • Codeless data-binding using the DataSourceControls in ASP.NET 2.0/3.5
    • Data-Binding to various data sources which implement the IEnumerable, IList or ICustomTypeDescriptor interfaces
    • Integrated paging
    • Integrated sorting
    • Easily customizable skinning mechanism (setting single Skin property of the treelist)
    • The ShowOuterBorders, ShowTreeLines and GridLines properties allow you to quickly change the appearance
    • Interoperability with RadAjax and loading indicators - dramatically improves the responsiveness of the component, simulates Windows-application like behavior, and minimizes the traffic to the server
    • Single and Multi-Row Server-Side and Client-Side Selection
    • The expanded and the selected state of the items is persisted while navigating through pages

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" Inherits="Telerik.TreeListExamplesCSharp.FirstLook.DefaultCS"
        CodeFile="DefaultCS.aspx.cs" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <telerik:HeadTag runat="server" ID="Headtag2" />
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <telerik:Header runat="server" ID="Header1" NavigationLanguage="CS" />
        <!-- content start -->
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadTreeList1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="CheckBox1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="CheckBox2">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="DropDownList1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="CheckBox3">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="CheckBox4">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="CheckBox5">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="CheckBox6">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTreeList1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
        <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configure RadTreeList"
            Expanded="true">
            <table>
                <tr>
                    <td style="width: 270px">
    <asp:CheckBox ID="CheckBox1" runat="server" Text="Show outer borders" Checked="true"
    AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged" /><br />

    <asp:CheckBox ID="CheckBox2" runat="server" Text="Show tree lines" Checked="true"
    AutoPostBack="true" OnCheckedChanged="CheckBox2_CheckedChanged" /><br />

                        Change grid lines:
                        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                            <asp:ListItem Selected="True">Both</asp:ListItem>
                            <asp:ListItem>Horizontal</asp:ListItem>
                            <asp:ListItem>None</asp:ListItem>
                            <asp:ListItem>Vertical</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="width: 270px;" valign="top">
    <asp:CheckBox ID="CheckBox3" runat="server" Text="Enable paging" Checked="true" AutoPostBack="true"
    OnCheckedChanged="CheckBox3_CheckedChanged" /><br />

    <asp:CheckBox ID="CheckBox4" runat="server" Text="Enable sorting" Checked="true"
    AutoPostBack="true" OnCheckedChanged="CheckBox4_CheckedChanged" />

                    </td>
                    <td valign="top">
    <asp:CheckBox ID="CheckBox5" runat="server" Text="Enable client-side items selection" Checked="false"
    AutoPostBack="true" OnCheckedChanged="CheckBox5_CheckedChanged" /><br />

    <asp:CheckBox ID="CheckBox6" runat="server" Text="Allow multi-item selection" Checked="false"
    AutoPostBack="true" OnCheckedChanged="CheckBox6_CheckedChanged" />

                    </td>
                </tr>
            </table>
        </qsf:ConfiguratorPanel>
        <telerik:RadTreeList ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource"
            ParentDataKeyNames="ParentID" DataKeyNames="ID" AllowPaging="true" PageSize="5"
            AutoGenerateColumns="false" AllowSorting="true">
            <Columns>
                <telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="Category ID" />
                <telerik:TreeListTemplateColumn DataField="ProductName" UniqueName="ProductName" HeaderText="Product">
                    <ItemTemplate>
                        <%# Eval("ProductName")%><%# Eval("Quantity").ToString() != "" ? "&nbsp;(" + Eval("Quantity").ToString() + ")" : ""%>
                    </ItemTemplate>
                    <HeaderStyle Width="300px" />
                </telerik:TreeListTemplateColumn>
                <telerik:TreeListBoundColumn DataField="Price" UniqueName="Price" DataFormatString="{0:C2}"
                    HeaderText="Price" DataType="System.Decimal">
                    <ItemStyle HorizontalAlign="Right" />
                </telerik:TreeListBoundColumn>
                <telerik:TreeListCheckBoxColumn DataField="InStock" UniqueName="InStock" HeaderText="In stock">
                    <HeaderStyle Width="60px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:TreeListCheckBoxColumn>
                <telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" HeaderText="Parent Category ID" />
            </Columns>
        </telerik:RadTreeList>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
        <!-- content end -->
        <telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451