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. General Programming
  3. C#
  4. datagrid-paging

datagrid-paging

Scheduled Pinned Locked Moved C#
helpquestion
2 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
    sanaziuse
    wrote on last edited by
    #1

    Hi everybody I have used a datagrid in my form. and every thing is Ok. I can see the items I want in datagrid but the problem is about paging. I have set the paging to 5 ..it means the datagrid should show 5 items in page 1 and the next 5 items in the next page( page 2 ) and ... but it doesnt work ... it shows the page but when I click on page 2 it already shows the items in page 1 ... I mean just page 1 works ...what should I do? whats wrong with properties or code? please tell me ... thank you very much. here is asection of my code : private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { FillDataGrid(); } } private void FillDataGrid() { cUpload upload=new cUpload(); bool Success; dsUpload1=upload.GetAllUpload(out Success); if(Success) { dgUpLoad.DataSource=dsUpload1.tblUpLoad; } dgUpLoad.DataBind(); }

    E 1 Reply Last reply
    0
    • S sanaziuse

      Hi everybody I have used a datagrid in my form. and every thing is Ok. I can see the items I want in datagrid but the problem is about paging. I have set the paging to 5 ..it means the datagrid should show 5 items in page 1 and the next 5 items in the next page( page 2 ) and ... but it doesnt work ... it shows the page but when I click on page 2 it already shows the items in page 1 ... I mean just page 1 works ...what should I do? whats wrong with properties or code? please tell me ... thank you very much. here is asection of my code : private void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { FillDataGrid(); } } private void FillDataGrid() { cUpload upload=new cUpload(); bool Success; dsUpload1=upload.GetAllUpload(out Success); if(Success) { dgUpLoad.DataSource=dsUpload1.tblUpLoad; } dgUpLoad.DataBind(); }

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

      You haven't handled the PageIndexChanged event. DataGrid1.CurrentPageIndex = e.NewPageIndex

      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