I've implemented a nested view template very similar to the example Nested View Template however I am implementing Edit and Insert of items into grids that reside in the template. On updates I'll be fine but on inserts, what I need is the datakey of the expanded row of the grid in the MasterTable.
Please see aspx below. When the user issues an Insert from the UserControl of grdEndorsements (AddEditEndorsement.ascx), what I need in order to complete the insert is the DataKeyNames="EntityID" from the expanded row of grdEntities. So the logic here is, the user expands the nested view under a given row in grdEntities, they see the grdEndorsements in the RadTabStrip/Multipage and they can insert a new item into grdEndorsements.
I know I can get the datakey name for grdEntities when it expands but I want to get it when the user actually inserts. It is possible that the user may expand more than one row in grdEntities and then go and insert into a row previously expanded. I've thought of a few possible solutions but open to suggestions.
What I've left out for brevity is the SQL data source of grdEndorsements. However, I bring it up since the Label ID="LabelEntityID" is the value I need to complete the insert, I use it as the parameter for the Data Source that feeds grdEndorsements and it works just fine. I'm just not sure how to get that value on insert.