Nested Repeater within Grid

E

Erica

I have a nested repeater within a grid:
<asp:Repeater ID="rptChildAllApproved" runat="server">
<HeaderTemplate>
<table width="100%"
cellpadding="0" cellspacing="0">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td
style="width: 50%;" align="left">* <%#CType(Container.DataItem,
DataRowView)("product_name")%></td>
<td
style="width: 35%;" align="left"> <%#CType(Container.DataItem,
DataRowView)("dt_approved")%></td>
<td
style="width: 15%;" align="left"> <%#CType(Container.DataItem,
DataRowView)("p2p_ind")%></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

I Bind the repeater in the Parent Grid's rowdatabound event:

Dim dv As DataRowView = CType(e.Row.DataItem, System.Data.DataRowView)
If dv IsNot Nothing Then
Dim RptProducts As New Repeater
For Each ctrl As Control In e.Row.Controls
If TypeOf ctrl Is Repeater Then
RptProducts = CType(ctrl, Repeater)
End If
Next
If RptProducts IsNot Nothing Then
RptProducts.DataSource = dv.CreateChildView("CompanyID")
RptProducts.DataBind()
End If
End If

The relation is created during load:

With EData
Dim drApproved As New DataRelation("CompanyIDAll",
..Approved.Tables(1).Columns(0), .Approved.Tables(0).Columns(0))
Dim drunApproved As New DataRelation("CompanyID",
..unApproved.Tables(1).Columns(0), .unApproved.Tables(0).Columns(0))
.Approved.Relations.Add(drApproved)
.NYApproved.Relations.Add(drunApproved)
End With

Edata is a structure that holds two datasets.

The parent table data is displaying fine. But the nested repeater is not
showing up at all. Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top