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

Integration with RadListView

ODataSource 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.

  • DefaultCS.aspx
  • scripts.js
  • styles.css
<%@ Page Language="C#"  %>

<%@ 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>
    <link rel="Stylesheet" type="text/css" href="styles.css" />
</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 size-wide">
        <telerik:RadListView ID="RadListView1" runat="server">
            <LayoutTemplate>
                <div id="itemContainer"></div>
            </LayoutTemplate>
            <ClientSettings>
                <DataBinding ItemPlaceHolderID="itemContainer">
                    <ItemTemplate>
                                <div class="item">
                                    <strong>#= ProductName #</strong>
                                    <br />
                                    Cost per package: $#= UnitPrice #
                                    <br />
                                    Available: #=UnitsInStock#
                                </div>
                    </ItemTemplate>
                </DataBinding>
            </ClientSettings>
        </telerik:RadListView>
    </div>
        <telerik:RadODataDataSource ID="RadODataDataSource1" runat="server">
            <Transport>
                <Read Url="https://demos.telerik.com/kendo-ui/service/Northwind.svc/" />
            </Transport>
            <Schema>
                <telerik:DataModel ModelID="Product" PageIndex="0" Set="Products" PageSize="50">
                    <telerik:DataModelField FieldName="ProductName" />
                    <telerik:DataModelField FieldName="UnitPrice" />
                    <telerik:DataModelField FieldName="UnitsInStock" />
                </telerik:DataModel>
            </Schema>
            <ClientEvents RequestSucceeded="requestSucceeded" />
        </telerik:RadODataDataSource>

    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            Sys.Application.add_load(function () {
                demo.oDataDataSource = $find("<%=RadODataDataSource1.ClientID%>");
                demo.listview = $find("<%=RadListView1.ClientID%>");

                demo.oDataDataSource.fetch("Product");
            });
        </script>
        <script type="text/javascript" src="scripts.js"></script>
    </telerik:RadScriptBlock>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance