pagination in repeater issue.

Discussion in 'ASP .Net Web Controls' started by Imran Aziz, Aug 8, 2005.

  1. Imran Aziz

    Imran Aziz Guest

    Hello All,
    I use the PagedDataSource class to do pagenation, the issue is that my
    dataset is a parent, child relation, and there can be updo 30 child item
    under each parent item, no since the pagination is based on the no of parent
    items, I get huge pages, is there a way to pagenate based on the child
    items?

    Here is my code

    PagedDataSource objPds = new PagedDataSource();

    objPds.DataSource = ds.Tables["Parent"].DefaultView;

    // Indicate that the data should be paged

    objPds.AllowPaging = true;

    // Set the number of items you wish to display per page

    objPds.PageSize = 10;

    // Set the PagedDataSource's current page

    objPds.CurrentPageIndex = CurrentPage;

    lblCurrentPage.Text = "Page: " + (CurrentPage + 1).ToString() + " of "

    + objPds.PageCount.ToString();

    lnkPrev.Visible = (!objPds.IsFirstPage);

    lnkNext.Visible = (!objPds.IsLastPage);

    repKeySources.DataSource = objPds;

    repKeySources.DataBind();


    Where the parent table is called, Parent, and the child table is called
    Child and the have a relationship say of column name ID.

    if parent has 10 rows, and child has 10 rows per parent, I end up with 100
    rows on the first page.

    I need to be able to pagenate based on the no of rows in the child table.


    Please help, thanks a lot.
    Imran.
    Imran Aziz, Aug 8, 2005
    #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. Joseph D. DeJohn

    DataGrid Pagination

    Joseph D. DeJohn, Jul 4, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,380
    Daniel Bass
    Jul 4, 2003
  2. Sreejumon[MVP]

    Re: datagrid custom pagination

    Sreejumon[MVP], Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    419
    Sreejumon[MVP]
    Jul 8, 2003
  3. Child
    Replies:
    0
    Views:
    330
    Child
    Aug 19, 2003
  4. Kruq

    DataList pagination

    Kruq, Apr 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    616
  5. Chaprasi
    Replies:
    1
    Views:
    6,080
    Karl Seguin [MVP]
    Feb 2, 2006
Loading...

Share This Page