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
100
looping through child bands
posted

I have this code in a Beforeselect changed event - and it works fine for the parent rows, but how do I access the child bands?

 

Dim rowSelected As UltraGridRow

' loop through all parent band(0) rows

For Each rowSelected In Me.UltraGrid1.Rows

Dim irow As Integer = rowSelected.Band.Index

If rowSelected.Activated = True Then

          rowSelected.Activated = False

          rowSelected.Appearance.BackColor = Color.White

End If

 

 THIS GIVES AN ERROR - WANTS A 'NEW'   KEYWORD.....

Dim band As UltraGridBand = Me.UltraGrid1.DisplayLayout.Bands(1)

For Each band In Me.UltraGrid1.Rows.ParentRow.ChildBands

Select Case band.Index

Case 1

Case 2

End Select

Next

 

 

Next

Parents
No Data
Reply
  • 9298
    posted

    Beverly,

    I'm not quite sure what you want to do in this code, but if you want to loop through all the rows in the grid, i.e., all the parent rows and all the child rows then instead of looping throught the Rows collection of UltraGrid1 you should loop through

    Me.UltraGrid1.Rows.GetFilteredInNonGroupByRows 

    Try that and let me know how it goes.

Children