Nested Repeater not binding properly

Discussion in 'ASP .Net Web Controls' started by Ray75, Oct 1, 2007.

  1. Ray75

    Ray75 Guest

    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
     
    Ray75, Oct 1, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim French
    Replies:
    0
    Views:
    627
    Jim French
    Jul 18, 2003
  2. Stephen Miller
    Replies:
    2
    Views:
    5,247
    Stevie_mac
    Aug 16, 2003
  3. Replies:
    0
    Views:
    903
  4. Alan Silver
    Replies:
    6
    Views:
    2,914
    Alan Silver
    Jul 13, 2005
  5. Ram
    Replies:
    1
    Views:
    3,218
    sriram
    Jul 27, 2007
Loading...

Share This Page