<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FrozenColumnsExample.aspx.cs" Inherits="FrozenColumnsExample" %>
<%@ 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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <!-- content start -->
        <div>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" DataSourceID="SqlDataSource1"
            Width="560px" Skin="Vista" AllowFilteringByColumn="True" AllowSorting="True"
            PageSize="15" ShowStatusBar="true" ShowFooter="True" AllowPaging="True" runat="server" 
            OnColumnCreated="RadGrid1_ColumnCreated"
            GridLines="None">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView AutoGenerateColumns="false" HeaderStyle-Width="250px" EditMode="InPlace" AllowFilteringByColumn="True"
                ShowFooter="True" TableLayout="Auto">
                <Columns>
                    <telerik:GridBoundColumn FilterControlWidth="110px" DataField="ShipName" HeaderText="ShipName" SortExpression="ShipName"
                        UniqueName="ShipName" HeaderStyle-Width="150px">
                    </telerik:GridBoundColumn>
                    <telerik:GridNumericColumn DataField="OrderID" HeaderText="OrderID" SortExpression="OrderID"
                        UniqueName="OrderID" FilterControlWidth="50px">
                    </telerik:GridNumericColumn>
                    
                    <telerik:GridDateTimeColumn FilterControlWidth="50px" DataField="OrderDate" HeaderText="OrderDate" SortExpression="OrderDate"
                        UniqueName="OrderDate" PickerType="None" DataFormatString="{0:d}">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridDateTimeColumn FilterControlWidth="120px" DataField="ShippedDate" HeaderText="ShippedDate" SortExpression="ShippedDate"
                        UniqueName="ShippedDate" PickerType="DatePicker" DataFormatString="{0:D}">
                        <HeaderStyle Width="160px" />
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn FilterControlWidth="50px" DataField="ShipCountry" HeaderText="ShipCountry" SortExpression="ShipCountry"
                        UniqueName="ShipCountry">
                    </telerik:GridBoundColumn>
                    <telerik:GridMaskedColumn FilterControlWidth="50px" DataField="ShipPostalCode" HeaderText="ShipPostalCode"
                        SortExpression="ShipPostalCode" UniqueName="ShipPostalCode" Mask="#####">
                        <FooterStyle Font-Bold="true" />
                    </telerik:GridMaskedColumn>
                    <telerik:GridNumericColumn FilterControlWidth="50px" DataField="Freight" DataType="System.Decimal" HeaderText="Freight"
                        SortExpression="Freight" UniqueName="Freight" Aggregate="Sum">
                        <FooterStyle Font-Bold="true" />
                    </telerik:GridNumericColumn>
                </Columns>
            </MasterTableView>
            
            <ClientSettings>
                <Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="1" />
            </ClientSettings>
        </telerik:RadGrid>

        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Orders" runat="server">
        </asp:SqlDataSource>
        
    </div>
    </form>
</body>
</html>
