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. repeating rows in datalist while i click 2nd or 3rd page navigation.

repeating rows in datalist while i click 2nd or 3rd page navigation.

Scheduled Pinned Locked Moved ASP.NET
help
3 Posts 2 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.
  • S Offline
    S Offline
    subbu sk
    wrote on last edited by
    #1

    Hai all, i have facing a problem while navigating to paging in datalist. i take 10 records for a page.it will display exact 10 records for the first time. if i click second page then it will disply 13 records (3 records from the first page last) and if i click 1 page fgrom 3rd page then also the records in the first page will be 13... pls help me..through any suggestions

    Thanks Subbu.

    E 1 Reply Last reply
    0
    • S subbu sk

      Hai all, i have facing a problem while navigating to paging in datalist. i take 10 records for a page.it will display exact 10 records for the first time. if i click second page then it will disply 13 records (3 records from the first page last) and if i click 1 page fgrom 3rd page then also the records in the first page will be 13... pls help me..through any suggestions

      Thanks Subbu.

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      Are you using custom paging or your own code for pageing, if its your own code please post

      S 1 Reply Last reply
      0
      • E eyeseetee

        Are you using custom paging or your own code for pageing, if its your own code please post

        S Offline
        S Offline
        subbu sk
        wrote on last edited by
        #3

        hi.. thanks for ur immediate reply.. pls check this* oncommand=NavigatePage Protected Sub NavigatePage(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Select Case e.CommandName Case "PageNumber" fintCurrentPage = Convert.ToInt32(e.CommandArgument) Dim strselection As String = "" strselection = SearchString If SearchRange.Length > 0 And strselection.Length > 0 Then strselection = strselection & " and " & SearchRange ElseIf SearchRange.Length > 0 Then strselection = SearchRange End If dsPros = getProList(strselection, SortString, fintCurrentPage, PAGE_SIZE) Dim intNoOfRecs As Int32 = 0 Dim intTotPages As Int32 = 0 intNoOfRecs = CType(dsPros.Tables(1).Rows.Count, Int32) intTotPages = CType(dsPros.Tables(0).Rows(0).Item(0), Int32) FormatNavigationMenuBar(fintCurrentPage, intTotPages, PAGE_SIZE, RECS_IN_LIST) dtlstPros.DataSource = dsPros.Tables(1) dtlstPros.DataBind() dtlstPros.UpdateAfterCallBack = True '' lblListStatus.Text = "Displaying " & (((fintCurrentPage - 1) * PAGE_SIZE) + 1).ToString & " to " & ((fintCurrentPage - 1) * PAGE_SIZE) + intNoOfRecs.ToString & " of " & intTotPages.ToString & " matches" lblListStatus.UpdateAfterCallBack = True End Select End Sub Protected Function FormatNavigationMenuBar(ByVal CurrentPageNo As Integer, ByVal TotalNoOfRecords As Integer, _ ByVal MaxNoOfProductsOnAPage As Integer, ByVal ForwardNumber As Integer) As String Dim intStartPageNo As Integer Dim intPageCounter As Integer Dim MaxNoOfBrowseToPageLinksOnAPage As Int32 MaxNoOfBrowseToPageLinksOnAPage = ForwardNumber Dim intTotalPages As Integer Dim objdtPageLink As New DataTable("PageLink ") Dim drPageLink As DataRow With objdtPageLink.Columns .Add("PageNumber", System.Type.GetType("System.String")) .Add("PageID", System.Type.GetType("System.String")) End With 'Compute Total No. of Pages intTotalPages = CInt(Math.Ceiling(TotalNoOfRecords / MaxNoOfProductsOnAPage)) '>> Finding Starting of series If (CurrentPageNo Mod MaxNoOfBrowseToPageLinksOnAPage) = 0 Then intStartPageNo = (CurrentPageNo + 1) - MaxNoOfBrowseToPageLinksOnAPage Else intStartPageNo = (CurrentPageNo - (CurrentPageNo Mod MaxNoOfBrowseToPageLinksOnAPage)) If intStartPageNo = 0 Then intStartPageNo = 1 Else intStartPageNo += 1 End If End

        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