<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
            var gridId = "<%= RadGrid1.ClientID %>";
            var currentPage = <%= RadGrid1.CurrentPageIndex %>;
            var pageSize = <%= RadGrid1.PageSize %>;
            var pageCount = <%= RadGrid1.PageCount %>;                       
            var sortAscUrl = '<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Office2007.Grid.SortAsc.gif") %>';
            var sortDescUrl = '<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Office2007.Grid.SortDesc.gif") %>';
        </script>

    </telerik:RadCodeBlock>

    <script type="text/javascript" src="ClientBindingExample.js"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>                
                <asp:ScriptReference Path="~/DataService.debug.js" />
            </Scripts>
        </asp:ScriptManager>
        <fieldset style="padding: 10px; height: 120px;">
            <legend style="margin-bottom: 10px;">Measurements:</legend><span id="timeData" style="color: red;
                font-weight: bold;"></span>
            <br />
            <span id="timeGrid" style="color: red; font-weight: bold;"></span>
        </fieldset>
        <br />
        <telerik:RadGrid ID="RadGrid1" AllowFilteringByColumn="True" DataSourceID="EntityDataSource1"
            Skin="Vista" runat="server" GridLines="None" AllowPaging="True" AllowSorting="True"
            OnItemCreated="RadGrid1_ItemCreated" OnColumnCreated="RadGrid1_ColumnCreated">
            <MasterTableView>                                           
                <PagerTemplate>
                    <span style="float: left; color: black;">Change page: &nbsp;
                        <img alt="Previuos page" src='prev.gif' border="0" onclick="onPageCommand('prev')"
                            style="cursor: pointer;" />
                        &nbsp;
                        <img alt="Next page" src='next.gif' border="0" onclick="onPageCommand('next')" style="cursor: pointer;" /></span>
                    <img id="loading" alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading3.gif") %>'
                        border="0" style="visibility: hidden; float: left; margin-left: 30px; margin-top: 2px;" />
                    <span style="float: right; color: black;">Displaying page <span id="currentPageLabel"
                        style="color: black;">1</span> of <span id="totalPagesLabel" style="color: black;">
                            <%# RadGrid1.PageCount %></span>, items <span id="startIndexLabel" style="color: black;">
                                1</span> to <span id="endIndexLabel" style="color: black;">10</span> of
                        <span id="totalItemsLabel" style="color: black;">
                            <%# RadGrid1.MasterTableView.VirtualItemCount %></span>.</span>
                </PagerTemplate>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=NorthwindEntities"
            DefaultContainerName="NorthwindEntities" EntitySetName="Customers" Select="it.[CustomerID], it.[CompanyName], it.[ContactName], it.[City], it.[Country]">
        </asp:EntityDataSource>
    </div>
    </form>
</body>
</html>
