<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Delete_ServerConfirm.aspx.cs"
  Inherits="Delete_ServerConfirm" %>

<%@ 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 ID="RadScriptManager1" runat="server">
  </telerik:RadScriptManager>
  <script type="text/javascript">
    function confirmClearSingleCallBack(args) {
      if (args == true) {
        var mtv = $find("<%=RadGrid1.ClientID %>").get_masterTableView();
        mtv.fireCommand("ConfirmDelete");
      }
    } 
  </script>
  <div>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateDeleteColumn="True" AllowAutomaticInserts="true"
      AllowAutomaticDeletes="true" DataSourceID="SqlDataSource1" OnItemCommand="RadGrid1_ItemCommand">
      <MasterTableView AutoGenerateColumns="False" DataKeyNames="ShipperID" DataSourceID="SqlDataSource1"
        CommandItemDisplay="Top">
        <Columns>
          <telerik:GridBoundColumn DataField="ShipperID" DataType="System.Int32" FilterControlAltText="Filter ShipperID column"
            HeaderText="ShipperID" ReadOnly="True" SortExpression="ShipperID" UniqueName="ShipperID">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="CompanyName" FilterControlAltText="Filter CompanyName column"
            HeaderText="CompanyName" SortExpression="CompanyName" UniqueName="CompanyName">
          </telerik:GridBoundColumn>
          <telerik:GridBoundColumn DataField="Phone" FilterControlAltText="Filter Phone column"
            HeaderText="Phone" SortExpression="Phone" UniqueName="Phone">
          </telerik:GridBoundColumn>
        </Columns>
      </MasterTableView>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
      DeleteCommand="DELETE FROM [Shippers] WHERE [ShipperID] = @ShipperID" InsertCommand="INSERT INTO [Shippers] ([CompanyName], [Phone]) VALUES (@CompanyName, @Phone)"
      SelectCommand="SELECT * FROM [Shippers]" UpdateCommand="UPDATE [Shippers] SET [CompanyName] = @CompanyName, [Phone] = @Phone WHERE [ShipperID] = @ShipperID">
      <DeleteParameters>
        <asp:Parameter Name="ShipperID" Type="Int32" />
      </DeleteParameters>
      <InsertParameters>
        <asp:Parameter Name="CompanyName" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
      </InsertParameters>
      <UpdateParameters>
        <asp:Parameter Name="CompanyName" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
        <asp:Parameter Name="ShipperID" Type="Int32" />
      </UpdateParameters>
    </asp:SqlDataSource>
  </div>
  </form>
</body>
</html>
