I have a 3-level RadGrid. In the MasterTable (ParentGrid), there's a
template column with a label (LocationID). The detailtable(ChildGrid) has a
commandItemTemplate "Add Contact". EditMode = popup. The popup is a
usercontrol having a RadGrid(radGrid_CompanyContactDetails).
Suppose there are 3 rows in the MasterTable. I click on a row. Then I click on "Add Contact" of the detail table, it opens the popup. Here I want to access the parent Grid's LocationID value for that particular row from the usercontrol's RadGrid's ItemDataBound event. I am able to access the RadGrid if I have the following code:
But if I give rGrid.FindControl("LocationID"), it returns null.
Please give some pointers on how to access the parent RadGrid's column values (or controls)
Suppose there are 3 rows in the MasterTable. I click on a row. Then I click on "Add Contact" of the detail table, it opens the popup. Here I want to access the parent Grid's LocationID value for that particular row from the usercontrol's RadGrid's ItemDataBound event. I am able to access the RadGrid if I have the following code:
protected void radGrid_CompanyContactDetails_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem) |
{ |
GridDataItem item = (GridDataItem)e.Item; |
radGrid rGrid = (Telerik.Web.UI.RadGrid)(item.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent); |
Label location = (Label)rGrid.FindControl("LocationID") // Returns null } |
} |
But if I give rGrid.FindControl("LocationID"), it returns null.
Please give some pointers on how to access the parent RadGrid's column values (or controls)