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

Need help on RadGrid

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ramesh
Top achievements
Rank 1
Ramesh asked on 01 May 2012, 07:14 AM
Hi All,

My question is very simple... I have a radgrid containing a Master table and detail table for each row. When I click on either of the row, I want to know, where did I clicked... Is it master table or detail table ? Is there any property to know on which table I clicked on (master or detail)...

Please help me out...

Thanks & Regards,
Ramesh Sambari

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 01 May 2012, 10:12 AM
Hello,

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
 
        if (e.CommandName == "RowClick" && e.Item is GridDataItem)
        {
            if(e.Item.ItemIndex.ToString() == e.Item.ItemIndexHierarchical.ToString())
            {
                // parent item
            }
else
{
  // child oitem
}

// OR
 
            if(e.Item.OwnerTableView.Name == "Parent")
            {
                //parent item
            }
            if(e.Item.OwnerTableView.Name == "Child")
            {
                // child item
            }
             
        }
}
<MasterTableView  Name="Parent">
..............
.............
  <DetailTables>
                    <telerik:GridTableView Name="Child">
.............
..............


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Ramesh
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or