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 / 300 000 Rows with LINQ

Example Configuration
Settings:

Measurements:Time to retrieve data: 138 ms (from Selecting to Selected LinqDataSource events)
Time to bind, aggregate(if needed) and render data: 267 ms
Server time: 405 ms (from Init to Render)

Total time: Perform sorting/paging/filtering/grouping operation to see total time

Drag a column header and drop it here to group by that column
ProductIDProduct nameUnit priceQuantity per unitUnits in stockDiscontinued
Page size:
select
 335104 items in 33511 pages
1Chai$18.0010 boxes x 20 bags39
2Chang$19.0024 - 12 oz bottles17
3Aniseed Syrup$10.0012 - 550 ml bottles13
4Chef Anton's Cajun Seasoning$22.0048 - 6 oz jars53
5Chef Anton's Gumbo Mix$21.3536 boxes0
6Grandma's Boysenberry Spread$25.0012 - 8 oz jars120
7Uncle Bob's Organic Dried Pears$30.0012 - 1 lb pkgs.15
8Northwoods Cranberry Sauce$40.0012 - 12 oz jars6
9Mishi Kobe Niku$97.0018 - 500 g pkgs.29
10Ikura$31.0012 - 200 ml jars31

  • This demo illustrates the optimized performance techniques incorporated in the ASP.NET 3.5 build of RadGrid. The control takes advantage of the new LINQ (Language Integrated Query) syntax introduced in ASP.NET 3.5 and performs aggregate calculations or executes sorting/filtering/paging operations by means of native LINQ expressions. This technique significantly reduce the time necessary to process these actions "behind the scenes" and allows you to handle millions of records within a few milliseconds.

    For better visual indication we output the period of time between the Init and Render stages of the control lifecycle just below the grid table. Please bare in mind that these optimizations are available only in the ASP.NET 3.5 build of the grid (the assembly resides in the /bin35 folder of the installation).

    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" CodeFile="defaultvb.aspx.vb" AutoEventWireup="false" Inherits="Telerik.GridExamplesVBNET.DataEditing.ProgramaticLinqUpdates.DefaultVB" %>

    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!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">
        <qsf:HeadTag ID="Headtag1" runat="server"></qsf:HeadTag>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <div>
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
                <qsf:Header ID="Header1" runat="server" NavigationLanguage="VB" />
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="CheckBox1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Label1" />
                                <telerik:AjaxUpdatedControl ControlID="Label2" />
                                <telerik:AjaxUpdatedControl ControlID="Label3" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="CheckBox2">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Label1" />
                                <telerik:AjaxUpdatedControl ControlID="Label2" />
                                <telerik:AjaxUpdatedControl ControlID="Label3" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="CheckBox3">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Label1" />
                                <telerik:AjaxUpdatedControl ControlID="Label2" />
                                <telerik:AjaxUpdatedControl ControlID="Label3" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                <telerik:AjaxUpdatedControl ControlID="Label1" />
                                <telerik:AjaxUpdatedControl ControlID="Label2" />
                                <telerik:AjaxUpdatedControl ControlID="Label3" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                    <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
                </telerik:RadAjaxManager>
                <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
                <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

                    <script type="text/javascript">
                  function RequestStart(sender, eventArgs)
                  {
                    //Log the start time
                    startTime = new Date();
                  }
                  function ResponseEnd(sender, eventArgs)
                  {
                    //Log the end time
                    var endTime = new Date();
                    //Display the total time
                    $get("<%= lblTotal.ClientID %>").innerHTML = endTime - startTime + " ms";

                  }
                    </script>

                </telerik:RadCodeBlock>
                <qsf:ConfiguratorPanel ID="ConfiguratorPanel1" runat="server" Expanded="true">
                    <table>
                        <tr>
                            <td style="width: 330px">
                                <fieldset style="padding: 10px; height: 100px">
                                    <legend style="margin-bottom: 10px">Settings:</legend>
    <asp:CheckBox ID="CheckBox3" Text="Enable caching" Checked="true" AutoPostBack="true"
    runat="server" />

                                    <br />
    <asp:CheckBox ID="CheckBox2" Text="Let RadGrid do sorting instead of SQL Server"
    AutoPostBack="true" runat="server" />

                                    <br />
                                    <asp:CheckBox ID="CheckBox1" Text="Show aggregates" AutoPostBack="true" runat="server" />
                                </fieldset>
                            </td>
                            <td style="width: 520px">
                                <fieldset style="padding: 10px; height: 100px;">
                                    <legend style="margin-bottom: 10px">Measurements:</legend>Time to retrieve data:
                                    <asp:Label ID="Label1" ForeColor="Red" Font-Bold="true" runat="server"></asp:Label>
                                    ms <em>(from Selecting to Selected LinqDataSource events)</em>
                                    <br />
                                    <b>Time to bind, aggregate(if needed) and render data: </b>
                                    <asp:Label ID="Label2" ForeColor="Red" Font-Bold="true" runat="server"></asp:Label>
                                    ms
                                    <br />
                                    Server time:
                                    <asp:Label ID="Label3" ForeColor="Red" Font-Bold="true" runat="server"></asp:Label>
                                    ms <em>(from Init to Render)</em>
                                    <br />
                                    <br />
                                    Total time:
                                    <asp:Label ID="lblTotal" ForeColor="Red" Font-Bold="true" runat="server">
                                      <i>Perform sorting/paging/filtering/grouping operation to see total time</i>
                                    </asp:Label>
                                </fieldset>
                            </td>
                        </tr>
                    </table>
                </qsf:ConfiguratorPanel>
                <br />
                <telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1"
                    DataSourceID="LinqDataSource1" AllowFilteringByColumn="True" AllowPaging="True"
                    AllowSorting="True" runat="server" ShowGroupPanel="true">
                    <PagerStyle Mode="NextPrevAndNumeric" />
                    <GroupingSettings CaseSensitive="false" />
                    <MasterTableView TableLayout="Fixed">
                        <Columns>
                            <telerik:GridNumericColumn Aggregate="Count" HeaderText="ProductID" DataField="ProductID"
                                UniqueName="ProductID" SortExpression="ProductID" HeaderStyle-Width="50px" FilterControlWidth="30px"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="equalto" ShowFilterIcon="false" />
                            <telerik:GridBoundColumn HeaderText="Product name" DataField="ProductName" UniqueName="ProductName"
                                SortExpression="ProductName" HeaderStyle-Width="180px" FilterControlWidth="140px"
                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" />
                            <telerik:GridNumericColumn Aggregate="Sum" DataFormatString="{0:C}" FooterAggregateFormatString="<b>Total Price:</b> {0:C}"
                                HeaderText="Unit price" DataField="UnitPrice" UniqueName="UnitPrice" SortExpression="UnitPrice"
                                FilterControlWidth="80px" HeaderStyle-Width="115px" />
                            <telerik:GridBoundColumn HeaderText="Quantity per unit" DataField="QuantityPerUnit"
                                UniqueName="QuantityPerUnit" SortExpression="QuantityPerUnit" HeaderStyle-Width="110px"
                                FilterControlWidth="90px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                                ShowFilterIcon="false" />
                            <telerik:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="<b>Total Units: </b>{0}"
                                HeaderText="Units in stock" DataField="UnitsInStock" UniqueName="UnitsInStock"
                                SortExpression="UnitsInStock" FilterControlWidth="80px" HeaderStyle-Width="120px" />
                            <telerik:GridCheckBoxColumn DataField="Discontinued" UniqueName="Discontinued" HeaderText="Discontinued"
                                HeaderStyle-Width="60px" />
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="true">
                    </ClientSettings>
                </telerik:RadGrid>
    <asp:LinqDataSource AutoPage="False" ID="LinqDataSource1" runat="server" ContextTypeName="LinqToSql.TelerikSamplesDataContext"
    TableName="LargeProducts"
    Select="new (ProductID, ProductName, QuantityPerUnit, UnitPrice, UnitsInStock, Discontinued)">

                </asp:LinqDataSource>
            <qsf:Footer ID="Footer1" runat="server"></qsf: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