Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
select

Grid / NET 3.5 DataSource Controls

LinqDataSource

Category IDCategory NameDescription
12
Page size:
select
 8 items in 2 pages
1BeveragesSoft drinks, coffees, teas, beers, and ales
2CondimentsSweet and savory sauces, relishes, spreads, and seasonings
3ConfectionsDesserts, candies, and sweet breads
4Dairy ProductsCheeses
5Grains/CerealsBreads, crackers, pasta, and cereal
6Meat/PoultryPrepared meats

EntityDataSource

ProductIDProductNameCategoryIDQuantity per UnitUnit PriceDiscontinued
Page size:
select
 65 items in 11 pages
5Chef Anton's Gumbo236 boxes21.35
6Grandma's Boysenberry Spread212 - 8 oz jars25.00
7Uncle Bob's Organic Dried Pears712 - 1 lb pkgs.30.00
10Ikura812 - 200 ml jars31.00
12Queso Manchego La Pastora410 - 500 g pkgs.38.00
13Konbu82 kg box6.00

  • You can use the below ASP.NET 3.5 DataSource control types for RadGrid data-binding:

    • LinqDataSource
    • EntityDataSource

    All you need to do is set the DataSourceID property of the RadGrid to the ID of the Data Source control. Then you use ASP.NET binding expressions (Eval or Bind) for the fields that will be visualized in the grid.

    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.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="vb" AutoEventWireup="false" Inherits="Telerik.RadGridExamplesVBNET.DataBinding.NET35DataSourceControls.DefaultVB"
        CodeFile="DefaultVB.aspx.vb" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
    <!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">
        <telerik:HeadTag runat="server" ID="Headtag2"></telerik:HeadTag>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <div>
            <telerik:Header runat="server" ID="Header1" NavigationLanguage="VB" ShowSkinChooser="true" />
            <!-- content start -->
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
                <h3>
                    LinqDataSource</h3>
                <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="LinqDataSource1" AllowSorting="true"
                    AllowPaging="true" PageSize="6" AllowFilteringByColumn="true" ShowStatusBar="true">
                    <PagerStyle AlwaysVisible="true" />
                </telerik:RadGrid>
                <h3>
                    EntityDataSource</h3>
                <telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="EntityDataSource1" AllowSorting="true"
                    AllowPaging="true" PageSize="6" AllowFilteringByColumn="true" ShowStatusBar="true">
                    <MasterTableView DataKeyNames="ProductID" AutoGenerateColumns="false">
                        <Columns>
                            <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" UniqueName="ProductID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" UniqueName="ProductName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="CategoryID" HeaderText="CategoryID" UniqueName="CategoryID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="QuantityPerUnit" HeaderText="Quantity per Unit"
                                UniqueName="QuantityPerUnit">
                            </telerik:GridBoundColumn>
                            <telerik:GridNumericColumn DataField="UnitPrice" HeaderText="Unit Price" UniqueName="UnitPrice">
                            </telerik:GridNumericColumn>
                            <telerik:GridCheckBoxColumn DataField="Discontinued" HeaderText="Discontinued" UniqueName="Discontinued">
                            </telerik:GridCheckBoxColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </telerik:RadAjaxPanel>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="LinqToSqlReadOnly.NorthwindReadOnlyDataContext"
    TableName="Categories" />

    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=NorthwindEntities"
    DefaultContainerName="NorthwindEntities" EntitySetName="Products" />

            <!-- content end -->
            <telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
        </div>
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451