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
140
Hierarchical UltraWebGrid not populating
posted

I have a stored procedure that returns two temp tables which are then populated to a hierarchical WebGrid.  I can return rows with no issues, as you can see by my response.write() lines.  However the WebGrid still displays "No data to display", even though all of this is happening during the UltraWebGrid1_DataBinding() event.  I can also confirm that the stored procedure works perfectly in SQL, as it builds the tables exactly to my specs.  Help?

 

Private Sub UltraWebGrid1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles UltraWebGrid1.dataBinding

        'Get the StudyID
        Dim StudyID As Integer = Request.QueryString("StudyID")
        If Not StudyID = Nothing Then
            StudyID_Textbox.Text = StudyID
        End If


        'Build the dataset for the UltraWebGrid
        Dim conn As SqlConnection = New SqlConnection(ConnectionString.getAppropriateString())
        Dim cmdMonthly As New SqlDataAdapter("sp_rs_View_All_Participant_Results " & StudyID, conn)
        Dim dsSpecimenDetails As New System.Data.DataSet
        cmdMonthly.Fill(dsSpecimenDetails, "TEMP_ParticipantLabResults")
        cmdMonthly.Fill(dsSpecimenDetails, "TEMP_ParticipantSpecimens")


        'Check for data
        If dsSpecimenDetails.Tables("TEMP_ParticipantLabResults").Rows.Count = 0 Or dsSpecimenDetails.Tables("TEMP_ParticipantSpecimens").Rows.Count = 0 Then
            Response.Write("no rows returned")
        Else
            'Ensure 61 total rows are returned
            Response.Write(dsSpecimenDetails.Tables("TEMP_ParticipantLabResults").Rows.Count)
            Response.Write(dsSpecimenDetails.Tables("TEMP_ParticipantSpecimens").Rows.Count)
        End If


        Try
            dsSpecimenDetails.Relations.Add("TEMP_ParticipantLabResults", dsSpecimenDetails.Tables("TEMP_ParticipantLabResults").Columns("SpecimenNumber"), dsSpecimenDetails.Tables("TEMP_ParticipantSpecimens").Columns("SpecimenNumber"))
        Catch ex As System.Exception
            Response.Write(ex.Message)
        End Try
        Me.UltraWebGrid1.DataSource = dsSpecimenDetails.Tables("TEMP_ParticipantLabResults").DefaultView

    End Sub 'UltraWebGrid1_DataBinding