Edit this page


If called from a nested GridTableView returns the parent item for the current nested hierarchical GridTableView. Returns null if called from the MasterTableView.

<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" AllowPaging="True" PageSize="3"
    OnNeedDataSource="RadGrid1_NeedDataSource" OnDetailTableDataBind="RadGrid1_DetailTableDataBind">
        <Selecting AllowRowSelect="true" />
        <ClientEvents OnRowSelected="rowSelected" />
    <MasterTableView DataKeyNames="CustomerID" ClientDataKeyNames="CustomerID"
        CommandItemDisplay="Top" Name="Customers">
            <telerik:GridTableView DataKeyNames="OrderID" Name="Orders">
function rowSelected(sender, args) {
    var tableView = args.get_tableView();

    if (tableView.get_name() == "Orders") {
        var parentRow = tableView.get_parentRow();
        var parentItem = $find(parentRow.id);

        var dataKeyValue = parentItem.getDataKeyValue("CustomerID");
        alert("Corresponding parent ID of the selected record is "
            + dataKeyValue + ".");
Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article