Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Nested Repeater not binding properly

Reply
Thread Tools

Nested Repeater not binding properly

 
 
Ray75
Guest
Posts: n/a
 
      10-01-2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wizard Control in Nested Master Pages - not working properly Ram ASP .Net 1 07-27-2007 03:11 PM
Repeater control with nested repeater chris.reed@digus.com ASP .Net 0 02-11-2005 05:10 PM
More American Graffiti: Properly Framed, Properly Scored? Scot Gardner DVD Video 0 09-02-2003 02:28 AM
Problem binding DataGrid nested inside Repeater Stephen Miller ASP .Net 2 08-16-2003 12:13 PM
Multiple tables not displayed when binding to a Repeater Jim French ASP .Net 0 07-18-2003 01:46 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57