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 / Custom Skin

Customize RadTreeList Appearance
Change grid lines:
Category ID Product (Name, Quantity) PriceIn 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

  • The demo shows how the RadTreeList control can be used with a custom non-embedded skin. If you are creating (using) a custom skin, which is based on an existing embedded skin, note that the RadTreeList uses the sprite image of the RadGrid's corresponding skin. In addition, you will need a custom skin with the same name for RadComboBox and/or RadInput and/or RadSlider, as these controls may appear in the RadTreeList pager.

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" />
        <link href="Clear/TreeList.Clear.css" rel="stylesheet" type="text/css" />
        <link href="Clear/ComboBox.Clear.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <telerik:Header runat="server" ID="Header1" NavigationLanguage="CS" ShowSkinChooser="false" />
        <!-- content start -->
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <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>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Customize RadTreeList Appearance"
            Expanded="true">
            <table>
                <tr>
                    <td style="width: 200px">
    <asp:CheckBox ID="CheckBox1" runat="server" Text="Show outer borders" Checked="true"
    AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged" />

                    </td>
                    <td style="width: 200px">
    <asp:CheckBox ID="CheckBox2" runat="server" Text="Show tree lines" Checked="true"
    AutoPostBack="true" OnCheckedChanged="CheckBox2_CheckedChanged" />

                    </td>
                    <td>
                        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>
                </tr>
            </table>
        </qsf:ConfiguratorPanel>
        <telerik:RadTreeList ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource"
            Skin="Clear" EnableEmbeddedSkins="false" ParentDataKeyNames="ParentID" DataKeyNames="ID"
            AllowPaging="true" PageSize="5" AutoGenerateColumns="false">
            <Columns>
                <telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="Category ID" />
                <telerik:TreeListTemplateColumn UniqueName="ProductName" HeaderText="Product">
                    <HeaderTemplate>
                        Product (Name, Quantity)
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%# Eval("ProductName")%><%# Eval("Quantity").ToString() != "" ? "&nbsp;(" + Eval("Quantity").ToString() + ")" : ""%>
                    </ItemTemplate>
                    <HeaderStyle Width="300px" />
                </telerik:TreeListTemplateColumn>
                <telerik:TreeListBoundColumn DataField="Price" UniqueName="Price" DataFormatString="{0:C}"
                    HeaderText="Price">
                    <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>
        <!-- content end -->
        <telerik:Footer runat="server" ID="Footer1" AdditionalCodeViewerFiles="~/TreeList/Examples/Appearance/CustomSkin/Clear/TreeList.Clear.css,~/TreeList/Examples/Appearance/CustomSkin/Clear/ComboBox.Clear.css">
        </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