Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Nested repeaters Paging problem

Nested repeaters Paging problem

Scheduled Pinned Locked Moved ASP.NET
designarchitecturehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MalikRizwan
    wrote on last edited by
    #1

    I have 2 Repeaters with ProductCategory and ProductDetail Architecture.. i.e master detail Wot i want to do is ... enable the paging as a whole rather than ProductCategory or ProductDetail .. Here is sample code for it strSQL = "SELECT ProductID, ShortDesc, LongDesc, SubCategoryID, PictureUrl, ProductCatID, DataSheetUrl " & _ " FROM dbo.Products ORDER BY ProductID" '& Request.QueryString("subid") strSqlMain = "SELECT ProductCatID, Description, SubCategoryID FROM dbo.ProductCategory Where SubCategoryID=" & Request.QueryString("subid") clsCon.MakeDataSet(strSQL, dsProduct) clsCon.MakeDataSet(strSqlMain, ds) ds.Tables(0).TableName = "Main" ds.Tables.Add(dsProduct.Tables(0).Copy()) ds.Tables(1).TableName = "Products" Dim str1(0) As String Dim str2(0) As String Dim dr As DataRelation = New DataRelation("ProductCat", ds.Tables("Main").Columns("ProductCatID"), ds.Tables("Products").Columns("ProductCatID"), False) ds.Relations.Add(dr) rptCategory.DataSource = ds rptCategory.DataBind() clsCon.sqlConnection.Close() And the ItemDataBound Event of Master Repeater is Protected Sub BindChild(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then If (CType(e.Item.DataItem, DataRowView).CreateChildView("ProductCat")).Count > 0 Then Dim rpt As Repeater = e.Item.Controls(3) Dim dsPaged As New PagedDataSource dsPaged.DataSource = (CType(e.Item.DataItem, DataRowView).CreateChildView("ProductCat")) dsPaged.AllowPaging = True dsPaged.PageSize = 7 dsPaged.CurrentPageIndex = CurrentPage lblCurrent.Text = "Page: " & (CurrentPage + 1).ToString & " of " & _ dsPaged.PageCount.ToString lblPrevious.Enabled = Not dsPaged.IsFirstPage lblNext.Enabled = Not dsPaged.IsLastPage rpt.DataSource = dsPaged rpt.DataBind() End If End If End Sub now problem is It makes the Paging enable on Product Repeater meanz .. if i have a Categories like CAT-A CAT-B,CAT-C and all of these categories has 10 items each .. then paging will work as first page will populate with 7 records of A,B,C, e

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups