New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

EntityDataSource

IDCategoriesParent ID
1
Page size:
45Agua 

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.

  • DefaultVB.aspx
<%@ Page Language="vb" AutoEventWireup="false"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <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">
                <Columns>
                    <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>
                </Columns>
            </telerik:RadTreeList>
        </telerik:RadAjaxPanel>
        <asp:EntityDataSource runat="server" ID="EntityDataSource1" ConnectionString="name=TelerikReadWriteEntities" DefaultContainerName="TelerikReadWriteEntities" EntitySetName="Links">
        </asp:EntityDataSource>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance