<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_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></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1"></telerik:RadScriptManager>
    <div>       
    
    <telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="False" 
            AllowPaging="True" AutoGenerateEditColumn="True" DataSourceID="SqlDataSource1" 
            GridLines="None" AllowAutomaticUpdates="true">        
        <MasterTableView DataKeyNames="OrderID" DataSourceID="SqlDataSource1">       
            <Columns>
                <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32" 
                    HeaderText="OrderID" ReadOnly="True" SortExpression="OrderID" 
                    UniqueName="OrderID">
                </telerik:GridBoundColumn>
                <telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime" 
                    PickerType="TimePicker" 
                    HeaderText="OrderDate" SortExpression="OrderDate" UniqueName="OrderDate">
                </telerik:GridDateTimeColumn>
                <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" 
                    SortExpression="ShipCity" UniqueName="ShipCity">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
        DeleteCommand="DELETE FROM [Orders] WHERE [OrderID] = @OrderID" 
        InsertCommand="INSERT INTO [Orders] ([OrderDate], [ShipCity]) VALUES (@OrderDate, @ShipCity)" 
        SelectCommand="SELECT [OrderID], [OrderDate], [ShipCity] FROM [Orders]" 
        UpdateCommand="UPDATE [Orders] SET [OrderDate] = @OrderDate, [ShipCity] = @ShipCity WHERE [OrderID] = @OrderID">
        <DeleteParameters>
            <asp:Parameter Name="OrderID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="OrderDate" Type="DateTime" />
            <asp:Parameter Name="ShipCity" Type="String" />
            <asp:Parameter Name="OrderID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="OrderDate" Type="DateTime" />
            <asp:Parameter Name="ShipCity" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
