AUTHOR: Marin Bratanov
DATE MODIFIED : January 07, 2018
DATE POSTED: September 14, 2017
How to access the DataItem of the parent RadGrid from a WebUserControl EditForm. How to do this in a nested scenario where one edit form can contain another grid and the third-level grid needs data from the top-level grid.
The grid populates the data item object when the edit/insert command is invoked (see the Edit Form Types demo). Subsequent postbacks may not populate it.
You can store the data in the ViewState of the user control when it loads initially, or the Session
Alternatively, you can traverse the control hierarchy of the grids and user controls and use the GetDataKeyValue() method the grid items expose to fetch data. You can find a small example of this attached below. Make sure to add the necessary fields in the DataKeyNames collection of the MasterTableView.