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

<!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>
    <style type="text/css">
        input.rgExpand
        {
            display: none;
        }
        input.rgCollapse
        {
            display: none;
        }
        td.rgExpandCol
        {
            width: 1px;
        }
    </style>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <div>
        <telerik:RadGrid ID="RadGrid1" Skin="Default" DataSourceID="dsParent" runat="server"
            Width="95%" AutoGenerateColumns="False" AllowPaging="True" GridLines="None" OnItemCommand="RadGrid1_ItemCommand">
            <MasterTableView Width="100%" DataKeyNames="CustomerID" DataSourceID="dsParent">
                <NestedViewTemplate>
                    <div style="width: 100%; border: 1px solid #33ccff;">
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%#Eval("CustomerID") %>' />
                    </div>
                </NestedViewTemplate>
                <Columns>
                    <telerik:GridBoundColumn HeaderText="CustomerID" DataField="CustomerID" UniqueName="CustomerID"
                        FilterListOptions="VaryByDataTypeAllowCustom">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Contact Name" DataField="ContactName" UniqueName="ContactName"
                        FilterListOptions="VaryByDataTypeAllowCustom">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Company" DataField="CompanyName" UniqueName="CompanyName"
                        FilterListOptions="VaryByDataTypeAllowCustom">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                        <ItemTemplate>
                            <asp:ImageButton ID="btnCollapse" runat="server" CommandName="ExpandCollapse" ImageUrl="~/SingleMinus.gif"
                                ToolTip="Collapse" Visible="False " />
                            <asp:ImageButton ID="btnExpand" runat="server" CommandName="ExpandCollapse" ImageUrl="~/SinglePlus.gif"
                                ToolTip="Expand" />
                        </ItemTemplate>
                        <HeaderStyle Width="40px" />
                        <HeaderTemplate>
                            <asp:LinkButton ID="ExpandAll" runat="server" CommandName="ExpandAll" Text="ExpandAll"
                                ToolTip="ExpandAll" />
                            <asp:LinkButton ID="CollapseAll" runat="server" CommandName="CollapseAll" Visible="False"
                                Text="CollapseAll" ImageUrl="~/RadControls/Grid/Skins/Office2007/SingleMinus.gif"
                                ToolTip="CollapseAll" />
                        </HeaderTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:AccessDataSource ID="dsParent" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT * FROM Customers"
            runat="server"></asp:AccessDataSource>
        <asp:AccessDataSource ID="dsChild1" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT * FROM Orders Where CustomerID = ?"
            runat="server">
            <SelectParameters>
                <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="string" />
            </SelectParameters>
        </asp:AccessDataSource>
    </div>
    </form>
</body>
</html>
