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
520
Get Child Rows
posted

I have a whdg and need to access the child rows from the parent row. More specifically, one of the columns on the parent row uses information from the child band to set its value. I have tried to get the information through the initialize row event as follows:

protected void whdg1_InitializeRow(object sender, RowEventArgs e)

        {

            //There is no method on e to get the child rows

        } 

 

I am looking for something that is similar to the Rows method in the UltraGrid:

 UltraGridRow row;

  row.Rows 

Parents
No Data
Reply
  • 33839
    Suggested Answer
    posted

    Hi bpg730,

    To access the child rows of a row, you have to go through its RowIslands collection to get to its child grids first.  So in this example.

    ContainerGridRecord row = (ContainerGridRecord)e.Row;
            ContainerGridRecordCollection childRows = row.RowIslands[0].Rows;

    Although depending upon load on demand and whether the children have been bound yet, these might not be available.

    regards,
    David Young

Children