RadODataDataSource - Telerik ASP.NET ODataDataSource

TreeView bound to self-referencing data
TreeView bound to 2 related data tables
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

The demo shows two types of binding: to self-referencing data and related data contained in different objects. The first treeview is bound to a single data model which has self-reference hierarchy structure. The second treeview rely on a data from two different data models with different end points.

About RadODataDataSource for ASP.NET AJAX

RadODataDataSource is a client data source component that allows querying local and remote services that expose OData feed. It features design-time wizard for visual configuration of the data model for the data, which should be obtained from the service.

RadODataDataSource and 90+ other controls are part of UI for ASP.NET AJAX, a comprehensive toolset taking care of the common functionality of your application, while leaving you with more time to work on its business logic.

Key Features

  • Codeless binding to web services exposing OData feed.
  • Design-time Wizard for easy configuration.
  • Rich client-side Api.

More about RadODataDataSource for ASP.NET AJAX
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="C#" CodeFile="DefaultCS.aspx.cs" Inherits="ODataDataSource.Examples.FirstLook.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!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">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />

    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />

    <telerik:RadODataDataSource runat="server" ID="RadODataDataSource1">
            <telerik:DataModel ModelID="Employee" Set="Employees">
                <telerik:DataModelField FieldName="EmployeeID" />
                <telerik:DataModelField FieldName="LastName" />
                <telerik:DataModelField FieldName="FirstName" />
                <telerik:DataModelField FieldName="ReportsTo" />

    <telerik:RadODataDataSource runat="server" ID="RadODataDataSource2">
            <telerik:DataModel ModelID="Category" Set="Categories">
                <telerik:DataModelField FieldName="CategoryID" />
                <telerik:DataModelField FieldName="CategoryName" />
            <telerik:DataModel ModelID="Product" Set="Products">
                <telerik:DataModelField FieldName="ProductName" />
                <telerik:DataModelField FieldName="ProductID" />
                <telerik:DataModelField FieldName="CategoryID" />

    <div class="demo-container size-thin">
        <div class="qsf-ex-one">
            <h6>TreeView bound to self-referencing data</h6>
            <telerik:RadTreeView RenderMode="Lightweight" runat="server" ID="RadTreeView1" ODataDataSourceID="RadODataDataSource1"
                DataModelID="Employee" DataFieldID="EmployeeID" DataFieldParentID="ReportsTo"
                DataTextField="FirstName" DataValueField="LastName" PersistLoadOnDemandNodes="false">
                <ClientNodeTemplate>#= Text # #= Value #</ClientNodeTemplate>
    <div class="demo-container size-thin">
        <div class="qsf-ex-two">
            <h6>TreeView bound to 2 related data tables</h6>
            <telerik:RadTreeView RenderMode="Lightweight" runat="server" ID="RadTreeView2" ODataDataSourceID="RadODataDataSource2" PersistLoadOnDemandNodes="false">
                    <telerik:RadTreeNodeBinding ModelID="Category" TextField="CategoryName" ValueField="CategoryID"
                        Depth="0" FieldID="CategoryID" />
                    <telerik:RadTreeNodeBinding ModelID="Product" TextField="ProductName" ValueField="ProductID"
                        Depth="1" FieldParentID="CategoryID" />

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?