jvwiv Posted May 12, 2008 Report Share Posted May 12, 2008 I have a child grid that I want to add a record to. The parent grid uses a unique key counter field that I need to pass into the child grid during record addition. I'm utilizing the following code to retrieve the ukid... Protected Sub Grid2_ItemInserting(ByVal sender As Object, ByVal e As GridFX.WebForms.GridItemInsertingEventArgs) Dim mod1 As IPQ = New IPQDim seqno As Int16 Dim ukid As Int16ukid = Grid1.SelectedItems(0).DataValues.PrimaryKey.ToString seqno = mod1.GetNextIPQNumber(ukid)e.DataValues.Item("ukid") = ukid e.DataValues.Item( "Sequence") = seqno End SubThe issue is that the ukid is not necessarily related to the grid record I'm working with. If I simply click on the + button to expand the child grid (grid2), the parent record that was used does not become the selected record and the ukid is not from the record that I'm adding. For example, record number 1 is currently selected. Click on the + button of record number 2 to show the children, click on the add button of grid # 2 and add the value. Run thru the code above and you'll see that the ukid is from record number 1, not record # 2. However, if I click on record number 2, then the + button, the selected UKID is that of record #2. How can I get the correct results? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.