<%@ Page Language="C#" AutoEventWireup="true"%>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>
            <telerik:RadAjaxLoadingPanel ID="Loading1" runat="server" Skin="Vista" Transparency="30">
            </telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="Loading1"
                Style="display: inline;">
                <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Vista" Width="800px" DataSourceID="AccessDataSource1"
                    AutoGenerateColumns="true"
                    AllowAutomaticUpdates="true" AllowAutomaticInserts="true" AllowMultiRowEdit="true">
                    <MasterTableView DataKeyNames="ShipperID" EditMode="inplace" CommandItemDisplay="top">
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                            </telerik:GridEditCommandColumn>
                        </Columns>
                        <CommandItemTemplate>
                            <table style="width:100%">
                                <tr>
                                    <td>
                                        <asp:ImageButton ID="InsertImageButton" runat="server" ImageUrl="Img/AddRecord.gif" CommandName="InitInsert" 
                                            ToolTip="Add new record"/>
                                        <asp:LinkButton ID="InsertButton" runat="server" CommandName="InitInsert">Add new record</asp:LinkButton>    
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="EditAllImageButton" runat="server" ImageUrl="Img/Edit.gif" CommandName="EditAll" 
                                            ToolTip="Edit all records"/>
                                        <asp:LinkButton ID="EditAllButton" runat="server" CommandName="EditAll">Edit all items</asp:LinkButton>
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="CancelAllImageButton" runat="server" ImageUrl="Img/Cancel.gif" CommandName="CancelAll" 
                                            ToolTip="Cancel all"/>
                                        <asp:LinkButton ID="CancelAllButton" runat="server" CommandName="CancelAll">Cancel all</asp:LinkButton>
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="UpdateAllimageButton" runat="server" ImageUrl="Img/Update.gif" CommandName="UpdateEdited" 
                                            ToolTip="Updated all edited items"/>
                                        <asp:LinkButton ID="UpdateAllButton" runat="server" CommandName="UpdateEdited">Update all edited items</asp:LinkButton>
                                    </td>
                                    <td align="right">
                                        <asp:ImageButton ID="RefreshImageButton" runat="server" ImageUrl="Img/Refresh.gif" CommandName="Rebind" 
                                            ToolTip="Refresh grid"/>
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                    </MasterTableView>
                </telerik:RadGrid>
            </telerik:RadAjaxPanel>
        </div>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
            ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [Shippers] WHERE [ShipperID] = ? AND [CompanyName] = ? AND (([Phone] = ?) OR ([Phone] IS NULL AND ? IS NULL))"
            InsertCommand="INSERT INTO [Shippers] ([ShipperID], [CompanyName], [Phone]) VALUES (?, ?, ?)"
            OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [ShipperID], [CompanyName], [Phone] FROM [Shippers]"
            UpdateCommand="UPDATE [Shippers] SET [CompanyName] = ?, [Phone] = ? WHERE [ShipperID] = ? AND [CompanyName] = ? AND (([Phone] = ?) OR ([Phone] IS NULL AND ? IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_ShipperID" Type="Int32" />
                <asp:Parameter Name="original_CompanyName" Type="String" />
                <asp:Parameter Name="original_Phone" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="CompanyName" Type="String" />
                <asp:Parameter Name="Phone" Type="String" />
                <asp:Parameter Name="original_ShipperID" Type="Int32" />
                <asp:Parameter Name="original_CompanyName" Type="String" />
                <asp:Parameter Name="original_Phone" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ShipperID" Type="Int32" />
                <asp:Parameter Name="CompanyName" Type="String" />
                <asp:Parameter Name="Phone" Type="String" />
            </InsertParameters>
        </asp:AccessDataSource>
    </form>
</body>
</html>
