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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Datapager in Listview

Datapager in Listview

Scheduled Pinned Locked Moved ASP.NET
databasehelp
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.
  • M Offline
    M Offline
    monika_vasvani
    wrote on last edited by
    #1

    Hello, My code is: if (!IsPostBack) { ds = cn.MasterBind("select * from TblEmp"); if (ds.Tables[0].Rows.Count > 0) { lstEmp.DataSource = ds.Tables[0]; lstEmp.DataBind(); dp1.Visible = true; dp1.SetPageProperties(0, dp1.MaximumRows, false); //ClearState(); } } i set datapager setproperties in page load and also i set on search button click event. dp1.SetPageProperties(0, dp1.MaximumRows, false); lstEmp.DataSource = dsParent.Tables[0]; lstEmp.DataBind(); But my search result will not display on first index of datapager.On first index my previous data is displayed when i click on 2 page,my search result is displayed. i also set false to true but it doesn't work. Do u have any suggestion,pls help me. Thanks

    R 1 Reply Last reply
    0
    • M monika_vasvani

      Hello, My code is: if (!IsPostBack) { ds = cn.MasterBind("select * from TblEmp"); if (ds.Tables[0].Rows.Count > 0) { lstEmp.DataSource = ds.Tables[0]; lstEmp.DataBind(); dp1.Visible = true; dp1.SetPageProperties(0, dp1.MaximumRows, false); //ClearState(); } } i set datapager setproperties in page load and also i set on search button click event. dp1.SetPageProperties(0, dp1.MaximumRows, false); lstEmp.DataSource = dsParent.Tables[0]; lstEmp.DataBind(); But my search result will not display on first index of datapager.On first index my previous data is displayed when i click on 2 page,my search result is displayed. i also set false to true but it doesn't work. Do u have any suggestion,pls help me. Thanks

      R Offline
      R Offline
      Rashmi_Karnam
      wrote on last edited by
      #2

      Set property of Datapager after binding your "lstEmp" on click of your Search button. As below lstEmp.DataSource = dsParent.Tables[0]; lstEmp.DataBind(); dp1.visible = true; dp1.SetPageProperties(0, dp1.MaximumRows, false); Its just a guess. I dont have time to check this out. Please give a try once. ;)

      Rashmi.M.K

      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