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

<%@ 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> Ticket 176186 </title>
    
    <script language="javascript" type="text/javascript">
        function ColumnMoving(sender, eventArgs) {
            if (eventArgs.get_gridSourceColumn().get_element().cellIndex < 3) {
                eventArgs.set_cancel(true);
                alert("Swapping columns with indices: " + eventArgs.get_gridSourceColumn().get_element().cellIndex + " and " + eventArgs.get_gridTargetColumn().get_element().cellIndex);
            } else if (eventArgs.get_gridSourceColumn().get_element().cellIndex >= 3 && eventArgs.get_gridTargetColumn().get_element().cellIndex < 3) {
                eventArgs.set_cancel(true);
                alert("Swapping columns with indices: " + eventArgs.get_gridSourceColumn().get_element().cellIndex + " and " + eventArgs.get_gridTargetColumn().get_element().cellIndex);
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
   
    <asp:ScriptManager ID="scriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadGrid ID="radGridTest" runat="server" AutoGenerateColumns="False" Width="97%" EnableViewState="True"
        AllowAutomaticUpdates="true" MasterTableView-AllowAutomaticUpdates="true" HeaderStyle-Font-Bold="true"
        AllowAutomaticInserts="True" AllowMultiRowEdit="True">
        <MasterTableView CommandItemDisplay="None" GridLines="Both" TableLayout="Fixed">
            <Columns>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="Name"
                    UniqueName="Name" DataField="Name">
                    <HeaderStyle Width="19%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="Value"
                    UniqueName="Value" DataField="Value">
                    <HeaderStyle Width="44%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="State"
                    UniqueName="State" DataField="State">
                    <HeaderStyle Width="4%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="Message"
                    UniqueName="Message" DataField="Message">
                    <HeaderStyle Width="27%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="MetaData"
                    UniqueName="MetaData" DataField="MetaData">
                    <HeaderStyle Width="0px" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="Variables"
                    UniqueName="Variables" DataField="Variables">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="Flags"
                    UniqueName="Flags" DataField="Flags">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataType="System.String" Display="true" HeaderText="OrgValue"
                    UniqueName="OrgValue" DataField="OrgValue">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <HeaderStyle Font-Bold="True" />
        <ClientSettings ReorderColumnsOnClient="True" AllowKeyboardNavigation="True" Selecting-AllowRowSelect="True"
            AllowColumnsReorder="true">
            <Selecting AllowRowSelect="True" />
            <ClientEvents OnColumnSwapping="ColumnMoving" />
            <Resizing AllowColumnResize="True" AllowRowResize="True" />
        </ClientSettings>
    </telerik:RadGrid>
    
    </form>
</body>
</html>
