<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>

<%@ 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">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:radscriptblock id="ScriptBlock1" runat="server">

        <script type="text/javascript">

            function onCommand(sender, args) {


            }
        
        
        </script>

    </telerik:radscriptblock>
    <telerik:radajaxmanager id="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:radajaxmanager>
    <telerik:radgrid id="RadGrid1" runat="server" >
        <MasterTableView AutoGenerateColumns="False" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"
            AllowCustomPaging="true" AllowFilteringByColumn="true" AllowSorting="true" AllowPaging="true"
            DataKeyNames="ProductID" CommandItemSettings-AddNewRecordText="Add New BMI Measure" CommandItemDisplay="Top">
            <Columns>
                <telerik:GridEditCommandColumn>
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" HeaderText="ProductID"
                    ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName"
                    UniqueName="ProductName">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="Discontinued" DataType="System.Boolean" HeaderText="Discontinued"
                    SortExpression="Discontinued" UniqueName="Discontinued">
                </telerik:GridCheckBoxColumn>
                <telerik:GridBoundColumn DataField="UnitsInStock" DataType="System.Int16" HeaderText="UnitsInStock"
                    SortExpression="UnitsInStock" UniqueName="UnitsInStock">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="UnitsOnOrder" DataType="System.Int16" HeaderText="UnitsOnOrder"
                    SortExpression="UnitsOnOrder" UniqueName="UnitsOnOrder">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" HeaderText="UnitPrice"
                    SortExpression="UnitPrice" UniqueName="UnitPrice">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CategoryID" DataType="System.Int32" HeaderText="CategoryID"
                    SortExpression="CategoryID" UniqueName="CategoryID">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="WebUserControl" UserControlName="" >

            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents />
        </ClientSettings>
    </telerik:radgrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [ProductID], [ProductName], [Discontinued], [UnitsInStock], [UnitsOnOrder], [UnitPrice], [CategoryID] FROM [Products]"
        DeleteCommand="DELETE FROM [Products] WHERE [ProductID] = @ProductID" InsertCommand="INSERT INTO [Products] ([ProductName], [Discontinued], [UnitsInStock], [UnitsOnOrder], [UnitPrice], [CategoryID]) VALUES (@ProductName, @Discontinued, @UnitsInStock, @UnitsOnOrder, @UnitPrice, @CategoryID)"
        UpdateCommand="UPDATE [Products] SET [ProductName] = @ProductName, [Discontinued] = @Discontinued, [UnitsInStock] = @UnitsInStock, [UnitsOnOrder] = @UnitsOnOrder, [UnitPrice] = @UnitPrice, [CategoryID] = @CategoryID WHERE [ProductID] = @ProductID">
        <DeleteParameters>
            <asp:Parameter Name="ProductID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="ProductName" Type="String" />
            <asp:Parameter Name="Discontinued" Type="Boolean" />
            <asp:Parameter Name="UnitsInStock" Type="Int16" />
            <asp:Parameter Name="UnitsOnOrder" Type="Int16" />
            <asp:Parameter Name="UnitPrice" Type="Decimal" />
            <asp:Parameter Name="CategoryID" Type="Int32" />
            <asp:Parameter Name="ProductID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="ProductName" Type="String" />
            <asp:Parameter Name="Discontinued" Type="Boolean" />
            <asp:Parameter Name="UnitsInStock" Type="Int16" />
            <asp:Parameter Name="UnitsOnOrder" Type="Int16" />
            <asp:Parameter Name="UnitPrice" Type="Decimal" />
            <asp:Parameter Name="CategoryID" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
