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
185
Dataset Binding
posted

I have a dataset, obtained from a webservice which contains 2 tables (a parent and child). I am presently binding it to the webhierarchicaldata grid. I presently have a bound checkbox column from the child table which the user can change.   To update the source data, I need to send the webservice the changes from the dataset (via the GetChanges dataset method).    How can I obtain which child rows have been changed on the server side (after user clicks an ASP button - Save)?

Thanks,

Hung

Parents
No Data
Reply
  • 16310
    Offline posted

    Hello,

    You can handle the RowUpdating event (or each other event corresponding to a CRUD operation - RowAdding, RowDeleting) and get this information from the event argument. Since e.Row will return references to the edited rows from both the parent and child bands, you can check the Level of the row (0 corresponds to parent, 1 corresponds to 1st level child and so on) and if the row comes from a child band you can add it to a list like this:

    List rows = new List();
    if (((ContainerGridRecord)e.Row).Level == 1)
     {
      rows.Add(e.Row);
     }

    You can also get e.Values to get collection of the updated values for the row.

    I hope this helps. If you have any further questions, please do not hesitate to contact me, I will be glad to help.

Children