<%@ 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 id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server" ID="ScriptManager1">
        </asp:ScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" OnDetailTableDataBind="RadGrid1_DetailTableDataBind">
            <MasterTableView AutoGenerateColumns="true" DataKeyNames="CustomerID"
                DataSourceID="SqlDataSource1" HierarchyDefaultExpanded="false" Name="Customers">
                <DetailTables>
                    <telerik:GridTableView runat="server" Name="Orders">
                        <DetailTables>
                            <telerik:GridTableView runat="server" Name="OrderDetails">
                            </telerik:GridTableView>
                        </DetailTables>
                    </telerik:GridTableView>
                </DetailTables>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT TOP 3 [CustomerID], [CompanyName], [ContactName], [Country] FROM [Customers]">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
            SelectCommand="SELECT [OrderID], [CustomerID], [OrderDate], [ShipCity], [ShipRegion] FROM [Orders] WHERE ([CustomerID] = @CustomerID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadGrid1" Name="CustomerID" PropertyName="SelectedValue"
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString3 %>"
            SelectCommand="SELECT * FROM [Order Details] WHERE ([OrderID] = @OrderID)" DeleteCommand="DELETE FROM [Order Details] WHERE [OrderID] = @OrderID">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadGrid1" Name="OrderID" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
