Silk skin

DropDownTree - Declarative DataSource


  • All


  • UI for ASP.NET Ajax
  • UI for Silverlight


  • Fuller
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB
RadDropDownTree supports binding to various types of data sources, including declarative datasources.

Some of the declarative data sources like the XmlDataSource and the SiteMapDataSourceare inherently hierarchical. Therefore when data-bound to these types of data sources, RadDropDownTree automatically creates the node hierarchy. There is no need to use the DataFieldID and DataFieldParentID properties.

RadDropDownTree supports binding to an ObjectDataSource as well. In addition to the standard Entry properties (Text, Value, etc.) that can be bound to the underlying business objects, the DataFieldID and DataFieldParentID properties can be specified, too. In this way, RadDropDownTree can create a hierarchy of Entries.

Still, the business objects should provide the data needed for the RadDropDownTree to build the hierarchy. If the ParentID property of the business objects are of nullable or reference type, then null values denote root Entry. In case, the ParentID property is of value type (Integer, Guid, etc.), '0'/'Guid.Empty' values denote the root Entry.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page AutoEventWireup="false" CodeFile="DefaultCS.aspx.cs" Inherits="DropDownTree.Examples.PopulatingWithData.DeclarativeDataSource.DefaultCS"Language="c#"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-containers">
        <div class="demo-container size-thin">

            <telerik:RadDropDownTree RenderMode="Lightweight" ID="RadDropDownTree1" runat="server" Width="300px" DefaultMessage="Please select"
                DataSourceID="SiteMapDataSource1" OnNodeDataBound="RadDropDownTree1_NodeDataBound">
        <div class="demo-container size-thin">

            <telerik:RadDropDownTree RenderMode="Lightweight" ID="RadDropDownTree2" runat="server" Width="300px" DefaultMessage="Please select"
                DataSourceID="ObjectDataSource1" DataFieldID="ID" DataFieldParentID="ParentID"
        <div class="demo-container size-thin">

            <telerik:RadDropDownTree RenderMode="Lightweight" ID="RadDropDownTree3" runat="server" Width="300px" DefaultMessage="Please select"
                DataFieldID="EmployeeID" DataFieldParentID="ReportsTo" DataTextField="LastName"
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"></asp:SiteMapDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetSiteData"
    <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT * From Employees"></asp:SqlDataSource>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?