Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
530
Problem adding new child records
posted

Hi,

I am having a problem with adding new child records. The problem is linking these child records to their parent. I am binding my whd to a generic list of objects, each of which may have child objects.

In the child object, I have a property called ParentID, which allows me to link exisitng child rows/objects to the parent rows/objects. However, the property is empty for new rows. I cant think of anything I can utilize in the row_adding event for the child row.

Parents
  • 33839
    Suggested Answer
    posted

    Hi vimaljonn,

    I can think of two approaches, one of which I have tried.  The first is to have a column in your child grids for the parent Id value.  You can hide this column and in the row adding client event, simply set it to the correct value.  Then you should be fine. 

    Another option would be to handle the row adding server event and try adding another key/value pair to eventArgs.Values.  This would contain your ParentId / val. 

    Let us know if you need more help.

    regards,
    David Young

Reply Children