<%@ 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.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>
    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">
            function pageLoad()
            {
                PageMethods.GetData(bindGrid);
            }
            function bindGrid(result)
            {
                var mtv = $find("<%=RadGrid1.ClientID %>").get_masterTableView();                
                mtv.set_dataSource(result);
                mtv.dataBind();
            }
            
            function Grid_DataBound(sender,args)
            {               
                args.get_item().get_element().cells[1].innerHTML = args.get_dataItem()["MyChild"].Name;
            }
        </script>
    </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
        <div>
     

        <telerik:RadScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" />
        <!-- content start -->
        
        <telerik:RadGrid ID="RadGrid1" runat="server">
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID"  />
                    <telerik:GridBoundColumn DataField="MyChild.Name" UniqueName="MyChild.Name" HeaderText="Name" />                    
                </Columns>
            </MasterTableView>           
            <ClientSettings>               
                <ClientEvents OnCommand="function(){}" OnRowDataBound="Grid_DataBound"/>
            </ClientSettings>
        </telerik:RadGrid>

            
        </div>
    </form>
</body>
</html>
