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
620
How can i reference a parent row and its child rows?
posted

How can i reference a parent row and its child rows?

Can anyone provide me the sample code for looping through all the child rows for a particular parent row, to check some cell  value? 

  • 469350
    Verified Answer
    Offline posted


                UltraGridRow parentRow = this.ultraGrid1.ActiveRow;

                foreach (UltraGridRow childRow in parentRow.ChildBands["key of child band"].Rows.GetAllNonGroupByRows())
                {
                    if ((int)childRow.Cells["My cell"].Value == 5
                    {
                        // Do something.
                    }
                }