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

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript" language="javascript">

                $telerik.$(window).load(function () {

                    Resize();



                    $(window).resize(function () {

                        Resize();

                    });

                });
                function Resize() {
                    debugger;
                    var grid = $find("<%= mygrid.ClientID %>");

                    if (grid != null) {

                        //  grid.get_element().style.height = $("#form1").height() + "px";

                        // grid.repaint();

                    }

                }
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadGrid ID="mygrid" runat="server" AutoGenerateColumns="true" DataSourceID="SqlDataSource1"
            AllowSorting="false" AllowPaging="true" PageSize="20">
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Customers"
            runat="server"></asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
