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

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:radgrid id="RadGrid1" AllowPaging="true" datasourceid="LinqDataSource1" runat="server">
                <MasterTableView DataKeyNames="CustomerID" >
                    <DetailTables>
                        <telerik:GridTableView DataSourceID="LinqDataSource2" runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields MasterKeyField="CustomerID" DetailKeyField="CustomerID" />
                            </ParentTableRelation>
                        </telerik:GridTableView>
                    </DetailTables>
                </MasterTableView>
             </telerik:radgrid>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DataClassesDataContext"
            TableName="Customers">
        </asp:LinqDataSource>
        <asp:LinqDataSource ID="LinqDataSource2" runat="server" ContextTypeName="DataClassesDataContext"
            TableName="Orders" Where="CustomerID = @CustomerID">
            <WhereParameters>
                <asp:Parameter Name="CustomerID" Type="String" />
            </WhereParameters>
        </asp:LinqDataSource>
    </div>
    </form>
</body>
</html>
