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

detail table in ItemCommand event

1 Answer 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rocky
Top achievements
Rank 1
rocky asked on 04 Mar 2011, 10:50 AM
How to find the detail table in ItemCommand Event in radgrid?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Mar 2011, 11:09 AM
Hello Rocky,

The following code snippet shows how to get the child tableview .

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
   {
      if (e.CommandName == "Your_Command_Name")
       {
           GridDataItem item = (GridDataItem)e.Item;
           if (item.Expanded)
                    GridTableView detailtable = (GridTableView)item.ChildItem.NestedTableViews[0];//accessing Child TableView of parent item
        }
   }

If you want to distinguish the grid items in hierarchy, please go through the following documentation.
Distinguish grid rows in hierarchy on ItemCreated/ItemDataBound

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