Putting one data row in each user control

liunx

Guest
I'm trying to itterate through a data table and display each row in a different user control. To go through the controls I've got this...


Dim intDivID As Integer = ddlDivisionID.SelectedValue
Dim x As Integer

m_kpmSAL = KickoffPickManager.GetKickOffPicksByDivisionIDSAL(intDivID)

If Not m_kpmSAL Is Nothing Then

Dim kpUC As New ucKickoffPicksUpdate

For x = 0 To panTeams.Controls.Count - 1

If TypeOf (panTeams.Controls.Item(x)) Is ucKickoffPicksUpdate Then
kpUC = panTeams.Controls.Item(x)
kpUC.ID = x
kpUC.Fill(x, intDivID)
End If

Next


However, the "If TypeOf (panTeams.Controls.Item(x)) Is ucKickoffPicksUpdate Then" line is only returning true every other time, so I end up with every other result missing on my page. Any ideas why?
 
Back
Top