TreeList - EntityDataSource

IDCategoriesParent ID
Page size:
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

RadTreeList can be bound to all ASP 3.5 DataSource control types like EntityDataSource.

All you need to do is set the DataSourceID property of the TreeList to the ID of the Data Source control and the corresponding DataKeyNames and ParentDataKeyNames. Then you can use ASP.NET binding expressions (Eval or Bind) for the fields that will be visualized in the treelist's body.

You may also see how to utilize Telerik OpenAccess ORM as a data access layer for our AJAX controls by visiting the OpenAccess ORM live demos here.

  • DefaultCS.aspx
<%@ Page 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>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container no-bg">
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="0"></telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel ID="RadAjaxPanel2" LoadingPanelID="RadAjaxLoadingPanel1" runat="server">
            <telerik:RadTreeList RenderMode="Lightweight" runat="server" ID="RadTreeList1" DataSourceID="EntityDataSource1" AllowPaging="true" PageSize="5" DataKeyNames="id" ParentDataKeyNames="parentId" AutoGenerateColumns="false">
                    <telerik:TreeListBoundColumn DataField="id" UniqueName="id" HeaderText="ID"></telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="Text" UniqueName="Categories" HeaderText="Categories"></telerik:TreeListBoundColumn>
                    <telerik:TreeListBoundColumn DataField="parentid" UniqueName="parentid" HeaderText="Parent ID"></telerik:TreeListBoundColumn>
        <asp:EntityDataSource runat="server" ID="EntityDataSource1" ConnectionString="name=TelerikReadWriteEntities" DefaultContainerName="TelerikReadWriteEntities" EntitySetName="Links">

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?