Nested Repeater not binding properly

R

Ray75

Hello,
I'm pulling a dataset that contains two result sets. 0 is a list
of details and 1 is a summary of the related parent items. (Yes that's
a little backward, but that's the order I ended up pulling them).
Anyway, I'm using the Relations.Add method to try and link the two
tables via a common field, but each Summary record on the web page is
returning every detail record instead of only the related ones. Can
anyone offer any help on this?

What I'm trying to get is the following
Summary 1
Summary1.Detail1
Summary1.Detail2
Summary1.Detail3
Summary 2
Summary2.Detail1
Summary2.Detail2

And what I am getting is
Summary 1
Summary1.Detail1
Summary1.Detail2
Summary1.Detail3
Summary2.Detail1
Summary2.Detail2
Summary 2
Summary1.Detail1
Summary1.Detail2
Summary1.Detail3
Summary2.Detail1
Summary2.Detail2



My code is...

Dim Invoices As DataSet

Public Sub SetData(ByVal sp() As SqlParameter)
Invoices = InvoiceCollection.SearchInvoiceDetails(sp)

Invoices.Relations.Add("invoiceRelation", _
Invoices.Tables(1).Columns("Invoice Ref"), _
Invoices.Tables(0).Columns("Invoice Ref"))

uxXSGridPagerWrapper.LoadData(Invoices.Tables(1),
"InvoiceSummary")
SessionInfo.PDFTable("InvoiceDetail") = Me.ToHTMLTable()
End Sub

Protected Sub rptInvoiceSearchResults_ItemDataBound(ByVal sender
As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs)
Handles rptInvoiceSearchResults.ItemDataBound
If e.Item.ItemType = ListItemType.AlternatingItem OrElse
e.Item.ItemType = ListItemType.Item Then
Dim rp As Repeater =
CType(e.Item.FindControl("rptInvoiceDetail"), Repeater)

rp.DataSource =
Invoices.Relations("invoiceRelation").ChildTable
rp.DataBind()
End If
End Sub
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top