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

[Solved] retrieve parent id while inserting through a usercontrol

2 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jan willem fransen
Top achievements
Rank 1
jan willem fransen asked on 09 May 2008, 10:03 PM
Hello,

I kinda combined this sample http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/UserControlEditForm/DefaultCS.aspx with a 2 level hierarchy.

Both levels have a usercontrol for display and edit information( and inserting). All works lovely. The only trouble is with retrieving the parentid while inserting in a client usercontrol.

Is there a sample around how to make this work ?

thanks!

--jw

2 Answers, 1 is accepted

Sort by
0
alan
Top achievements
Rank 1
answered on 10 May 2008, 11:32 AM
0
jan willem fransen
Top achievements
Rank 1
answered on 10 May 2008, 12:20 PM
smiles, as usual, some more digging helps as well.

For me this worked very nicely, adding it to the mainform. It fires when clicing "new entry" in the sub grid.

Private Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind

Session.Add(

"idBedrijf", CInt(e.DetailTableView.ParentItem.GetDataKeyValue("idBedrijf")))

End Sub

Thanks for the sample, I will have a look at it aswell. Seems from the quick glance it's a different approach.

Tags
Grid
Asked by
jan willem fransen
Top achievements
Rank 1
Answers by
alan
Top achievements
Rank 1
jan willem fransen
Top achievements
Rank 1
Share this question
or