Inner Repeater not displaying data

I have a page with an outer Repeater and an inner Repeater.

The behind code is in VB.NET.

The outer Repeater is executing just fine, but the inner repeater does not display any data.

I have confirmed that there is data there for it to display.

Here is my code:
aspx.vb:
Protected Sub LoadData()
        Dim conn As New SqlConnection
        Dim cmd As New SqlCommand
        Dim connstring As String
        Dim da As New SqlDataAdapter
        Dim dt As New DataTable
        Dim ds As New Data.DataSet

        connstring = Connector.ConnectStringBuild
        conn.ConnectionString = connstring
        cmd.Connection = conn
        cmd.CommandText = "ACT_GET_COLLECTION_DETAILS"
        cmd.CommandType = CommandType.StoredProcedure


        cmd.Parameters.Add("@SERVICE_ID", SqlDbType.Int).Value = SetVars.Service_ID
        cmd.Parameters.Add("@LOGON_NAME", SqlDbType.VarChar).Value = SetVars.UserName
        cmd.Parameters.Add("@INDICATOR", SqlDbType.VarChar).Value = SetVars.Indicator

        conn.Open()
        da.SelectCommand = cmd
        da.Fill(ds, "ACT_COLLECTION")

        conn.Close()

        cmd.CommandText = "ACT_GET_FUNCTION_SERVICE_DETAILS"
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.Clear()
        cmd.Parameters.Add("@GROUP_NAME", SqlDbType.VarChar).Value = SetVars.GroupName
        cmd.Parameters.Add("@SERVICE_ID", SqlDbType.Int).Value = SetVars.Service_ID
        cmd.Parameters.Add("@OBJECT_NAME", SqlDbType.VarChar).Value = "COLLECTION"
        'cmd.Parameters.Add("@COLLECTION_ID", SqlDbType.Int).Value = 7

        conn.Open()
        Dim da1 As New SqlDataAdapter
        da1.SelectCommand = cmd
        da1.Fill(ds, "ACT_PERMISSION")

        ds.Relations.Add("COLLECTION_ID_Relation", ds.Tables(0).Columns("COLLECTION_ID"), ds.Tables(1).Columns("COLLECTION_ID"))

        Me.ParentRepeater.DataSource = ds.Tables(0)
        Me.ParentRepeater.DataBind()
        conn.Close()




    End Sub

asp:
<asp:Repeater ID="ParentRepeater" runat="server">
        <HeaderTemplate>
        <table style="LEFT: 178px; WIDTH: 980px; POSITION: absolute; TOP: 195px" id="DataTable">
        <tr>
        <th class="intraContent"><b>Action</b></th>
        <th class="intraContent"><b>Collection Name</b></th>
        <th class="intraContent"><b>Current Version</b></th>
        <th class="intraContent"><b>Description</b></th>
        <th class="intraContent"><b>Lifecycle </b></th>
        <th class="intraContent"><b>Environment</b></th>
        <th class="intraContent"><b>Released On</b></th>
        <th class="intraContent"><b>Published On </b></th>
        <th class="intraContent"><b>Packages</b></th>
        <th class="intraContent"><b>Queries</b></th>
        <th class="intraContent"><b>Hosts</b></th>
        </tr>
       
        </headertemplate>
        <ItemTemplate>
         <asp:repeater ID="InnerRepeater" runat="Server">
        <ItemTemplate>
        <tr>
        <td class="intraContent">
        <%#DataBinder.Eval(Container.DataItem, "COLLECTION_ID")%>
        </td>
         </ItemTemplate>
        </asp:repeater>
        <td class="intraContent" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><%#DataBinder.Eval(Container.DataItem, "COLLECTION_NAME")%></td>
       
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><%#DataBinder.Eval(Container.DataItem, "Current_Version")%></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><%#DataBinder.Eval(Container.DataItem, "DESCRIPTION")%></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><%#DataBinder.Eval(Container.DataItem, "LIFECYCLE")%></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><%#DataBinder.Eval(Container.DataItem, "ENVIRONMENT")%></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><% Response.Write("????")%></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><%#DataBinder.Eval(Container.DataItem, "PUBLISHED_ON")%></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><asp:linkbutton runat="server" ID="linkButtonc1" CssClass="lnkbutton" CommandName="PACKAGES_COUNT" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"COLLECTION_ID") %>'><%#DataBinder.Eval(Container.DataItem, "PACKAGES")%></asp:linkbutton></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><asp:linkbutton runat="server" ID="linkButtonc2" CssClass="lnkbutton" CommandName="QUERIES_COUNT" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"COLLECTION_ID") %>'><%#DataBinder.Eval(Container.DataItem, "QUERIES")%></asp:linkbutton></td>
        <td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3" onmouseover="this.className='intraContentHover'" onmouseout="this.className='intraContent'"><asp:linkbutton runat="server" ID="linkButtonc3" CssClass="lnkbutton" CommandName="HOSTS_COUNT" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"COLLECTION_ID") %>'><%#DataBinder.Eval(Container.DataItem, "HOSTS") %></asp:linkbutton></td>
        </tr>
        </ItemTemplate>
        <FooterTemplate>
       
        </table>
        </FooterTemplate>
        </asp:Repeater>

When I specify a datasource for the inner Repeater I get errors.

Anyway, what I get with the above code is data for the outer Repeater, but no data for the inner Repeater.

Any ideas?? PLease help!
Thank you!
rss2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DarkoLordCommented:
Well, you need to specify a datasource for the inner repeater as there is nothing for it to display without a datasource. What error do you get?
0
craskinCommented:
generally, when i nest repeaters i use a separate function that returns the data i want for the nested repeater. so i'd have something like

Sub Repeater1Load()
    get the data
    bind to repeater1
End Sub

Function NestedData(var1, var2) As DataTable
    return the data with those variables
End Function

<asp:Repeater id="repeater1" ...>
    <itemtemplate>

              <asp:Repeater id="repeater2" datasource='<%# NestedData(Container.DataItem("item1"), Container.DataItem("item2")) %>'>
0
rss2Author Commented:
If done your way, where do you make the relation between the two tables?
0
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

craskinCommented:
doing what i do, the relation is done by filtering to only those records that apply to the variables sent to the function. say i had a table of people with ID and Name and a table of children with PersonID and ChildName. if you wanted to do a nested repeater with this data (though there is of course a better way to display this kind of data), you'd first bind the person table to the first repeater. then create a function that pulls only the children where PersonID = the ID of the outer repeater's current datarow. so it'd be something like

Function Children(ByVal ID as Integer) As DataTable
      select all children from table here or select only children where PersonID = ID
      if selected all then remove from datatable where PersonID <> ID
      return datatable
End Function

then the nested repeater datasource would = '<%# Children(Container.DataItem("ID")) %>'
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rss2Author Commented:
When I do it this way, and I reference the dropdownlist within function Children, I get a blue squiggly line underneath it with the error "Name 'ActionDropDownList' is not declared.'

(I gave the dropdownlist the id ActionDropDownList)

why can't I see <asp:Dropdownlist> from wtihin the repeater? If I take it outside the context of the repeater I can see it in my code but not when it's within it.
0
rss2Author Commented:
OMG this has been such a pain to get working.

Finally it's compiling but such an incredible amount of pain I've gone through to get this working.

Okay I think I'm coming down the home stretch now..this question should be easy for you. I'm just so exhausted I can't think straight.

Here's a fragment from my aspx page:
<td class="intraContent">
<asp:DropDownList ID="ActionDropDownList" runat="Server" AutoPostBack="true" OnDataBinding="DropDownListSelect">
</asp:DropDownList>
<asp:Label ID="lblStatus" runat="Server"></asp:Label>
<asp:Repeater ID="InnerRepeater" runat="Server">
<ItemTemplate>


</ItemTemplate>
</asp:Repeater>

and in the code behind file, I have DropDownListSelect which is called when the dropdownlist is bound to data.
    Protected Sub DropdownListSelect(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim conn As New SqlConnection
        Dim cmd As New SqlCommand
        Dim connstring As String
        Dim da As New SqlDataAdapter
        Dim dt As New DataTable
        Dim ds As New Data.DataSet

        'Dim theDropDownList As New DropDownList
        'theDropDownList = CType(FindControl("ActionDropDownList"), DropDownList)

        Dim childa As New SqlDataAdapter
        connstring = Connector.ConnectStringBuild
        conn.ConnectionString = connstring
        cmd.Connection = conn
        cmd.CommandText = "ACT_GET_FUNCTION_SERVICE_DETAILS"
        cmd.CommandType = CommandType.StoredProcedure

        cmd.Parameters.Add("@GROUP_NAME", SqlDbType.VarChar).Value = SetVars.GroupName
        cmd.Parameters.Add("@SERVICE_ID", SqlDbType.Int).Value = SetVars.Service_ID
        cmd.Parameters.Add("@OBJECT_NAME", SqlDbType.VarChar).Value = "COLLECTION"

        conn.Open()
        childa.SelectCommand = cmd
        'childa.Fill(dt)
        childa.Fill(ds)
        Dim theDropDownList As New DropDownList

        'theDropDownList = CType(e.Item.FindControl("ActionDropDownList"), DropDownList)
        theDropDownList.DataSource = ds
        theDropDownList.DataBind()


    End Sub

When I run the page, nothing is in the drop down list. What the heck am I doing wrong?

Thanks,
rss2
0
rss2Author Commented:
What do I need to do to actually get the data from the dataset ds inside the dropdownlist?

This is killing me I just can't figure it out!
0
rss2Author Commented:
Is anybody out there??

For the parent repeater, I have
Protected Sub ParentRepeater_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
        Dim ddl As New DropDownList
        ddl = CType(e.Item.FindControl("DropDownListinside"), DropDownList)
        ddl.DataSource = ds
        ddl.DataBind()

..but on the line that says:
CType(e.Item.FindControl("DropDownListinside"),DropDownList)

the ddl object that I instantiate goes to "Nothing" after that line.

So I'm assuming it's not finding the correct control.

How do I get it to find the correct control??? This is maddening.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.