I have a nested listview control. The OnItemDataBound command for the parent passes a parameter to the child listview and populates it. This all works fine. See test app at http://cobirds.org/CFO/Conventions/TestList.aspx
My problem comes when I try to apply an OnItemDataBound command to the child listview. My code works fine for the first children but is not completing the loop for the child in the last parent. In my test cited above I added counters. There should be four parents and 44 children but the last three are never read. Do any of you experts have an idea of why it would bounce out at the last parent? For demo purposes I have changed things to close a trip when there is one person registered. You can see that it works fine on the first three dates but not the last one.
Protected Sub lvNested_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.ListViewItemEventArgs)
Dim child As Integer = 0
For Each item As ListViewItem In ListView1.Items
Dim lvNested As ListView = DirectCast(item.FindControl("lvNested"), ListView)
child += lvNested.Items.Count
For Each row As ListViewItem In lvNested.Items
Dim hfMaxNo As HiddenField = DirectCast(row.FindControl("hfMaxNo"), HiddenField)
Dim hfRegistered As HiddenField = DirectCast(row.FindControl("hfRegistered"), HiddenField)
Dim cbSelect As CheckBox = DirectCast(row.FindControl("cbSelect"), CheckBox)
Dim ClosedLabel As Label = DirectCast(row.FindControl("ClosedLabel"), Label)
Dim MaxNo As Integer = 1
Dim Registered As Integer = hfRegistered.Value
If Registered > MaxNo Then
ClosedLabel.Text = "Trip Closed! "
cbSelect.Visible = False
ClosedLabel.Text = ""
cbSelect.Visible = True
cbSelect.Enabled = True
lblTestTrips.Text = "Parent: " & ListView1.Items.Count & " Children: " & child