This is a migrated thread and some comments may be shown as answers.

Hierarchy grid – client side rowselected

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 16 Mar 2011, 03:21 AM

In the hierarchy grid the allowrowselect is set to true. How can I tell if the row selected is from the master table view or detail table view on the client side script (rowselected). Please advise.

Thanks
RJ

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 16 Mar 2011, 05:31 AM
Hello RJ,

The following code snippet shows how to distinguish the row selection in hierarchy.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server">
    <MasterTableView Name="Master">
        <Columns>
         .   .   .   .   .
        </Columns>
        <DetailTables>
            <telerik:GridTableView Name="DetailTable" runat="server">
               .  .   .   .
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
    <ClientSettings Selecting-AllowRowSelect="true">
        <ClientEvents OnRowSelecting="OnRowSelecting" />
    </ClientSettings>
</telerik:RadGrid>

C#:
<script type="text/javascript">
      function OnRowSelecting(sender, args) {
        if (args.get_tableView().get_name() == "Master") {
            alert("Master table");
        }
        else
            alert("Detail table");
    }
</script>

Thanks,
Princy.
Tags
Grid
Asked by
RJ
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or