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
  • Rate / Review
    • Give your Feedback:

      Rate this demo:


Grid / Migration from GridView

RadGrid style with paging enabled

Product IDProduct NameQuantity Per UnitUnit PriceUnits In StockDiscontinued
 Page 1 of 8, items 1 to 10 of 77.
1Chai10 boxes x 20 bags18.0039
2Chang24 - 12 oz bottles19.0017
3Aniseed Syrup12 - 550 ml bottles10.0013
4Chef Anton's Cajun Seasoning48 - 6 oz jars22.0053
5Chef Anton's Gumbo Mix36 boxes21.350
6Grandma's Boysenberry Spread12 - 8 oz jars25.00120
7Uncle Bob's Organic Dried Pears12 - 1 lb pkgs.30.0015
8Northwoods Cranberry Sauce12 - 12 oz jars40.006
9Mishi Kobe Niku18 - 500 g pkgs.97.0029
10Ikura12 - 200 ml jars31.0031

ASP.NET GridView with paging enabled

ProductIDProductNameQuantityPerUnitUnitPriceUnitsInStockDiscontinued
1Chai10 boxes x 20 bags18.0039
2Chang24 - 12 oz bottles19.0017
3Aniseed Syrup12 - 550 ml bottles10.0013
4Chef Anton's Cajun Seasoning48 - 6 oz jars22.0053
5Chef Anton's Gumbo Mix36 boxes21.350
6Grandma's Boysenberry Spread12 - 8 oz jars25.00120
7Uncle Bob's Organic Dried Pears12 - 1 lb pkgs.30.0015
8Northwoods Cranberry Sauce12 - 12 oz jars40.006
9Mishi Kobe Niku18 - 500 g pkgs.97.0029
10Ikura12 - 200 ml jars31.0031
12345678


  • The declarative syntax of Telerik RadGrid is quite similar to that of the Microsoft GridView control, which makes the migration a pretty straightforward task. Compare the source codes in the ASPX tab.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" Inherits="Telerik.GridExamplesCSharp.GeneralFeatures.Migration.DefaultCS"
        CodeFile="DefaultCS.aspx.cs" %>

    <%@ 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" %>
    <!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>
        <style type="text/css">
        .GridPager div
        {
          display: inline;
        }
        .GridPager div:first-child
        {
          float: left;
        }
        .GridPager a
        {
          margin: 0 2px;
        }
        .GridPager div+div
        {
          float: right;
        }
        </style>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
            <div>
                <telerik:Header runat="server" ID="Header1" NavigationLanguage="CS" ShowSkinChooser="false"></telerik:Header>
                <!-- content start -->
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
                <telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
                    runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="GridView1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="GridView1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="5">
                </telerik:RadAjaxLoadingPanel>
                <h3 class="qsfSubtitle">
                    RadGrid style with paging enabled</h3>
                <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowPaging="True" runat="server"
                    Skin="">
                  <PagerStyle Mode="NumericPages" CssClass="GridPager" />
                </telerik:RadGrid>
                <br />
                <h3 class="qsfSubtitle">
                    ASP.NET GridView with paging enabled</h3>
                <asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" AllowPaging="True" runat="server">
                </asp:GridView>
                <br />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                    ProviderName="System.Data.SqlClient" SelectCommand="SELECT ProductID, ProductName, QuantityPerUnit, UnitPrice, UnitsInStock, Discontinued FROM 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