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. griddview pageIndexChanged() event

griddview pageIndexChanged() event

Scheduled Pinned Locked Moved ASP.NET
cssquestion
8 Posts 4 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.
  • K Offline
    K Offline
    kishorg1
    wrote on last edited by
    #1

    i have grid view in which i have allow paging.......so i have 10 pages.123456789...n so on to get all pages i hv write the code as follwes. protected void grdvwUpdt_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataTable dsAllUpdtblData = ViewState["dvAllUpdtblData"] as DataTable; grdvwUpdt.PageIndex = e.NewPageIndex; grdvwUpdt.DataSource = dsAllUpdtblData; grdvwUpdt.DataBind(); } when i click on any no ....it dnt show any change.....it must hv to give remaining record...but it didnt shoe tht why?

    C S 2 Replies Last reply
    0
    • K kishorg1

      i have grid view in which i have allow paging.......so i have 10 pages.123456789...n so on to get all pages i hv write the code as follwes. protected void grdvwUpdt_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataTable dsAllUpdtblData = ViewState["dvAllUpdtblData"] as DataTable; grdvwUpdt.PageIndex = e.NewPageIndex; grdvwUpdt.DataSource = dsAllUpdtblData; grdvwUpdt.DataBind(); } when i click on any no ....it dnt show any change.....it must hv to give remaining record...but it didnt shoe tht why?

      C Offline
      C Offline
      chandralekha
      wrote on last edited by
      #2

      In page Index Changing no need to rebind gridview. Only this much is enough grdvwUpdt.PageIndex = e.NewPageIndex;

      K 1 Reply Last reply
      0
      • C chandralekha

        In page Index Changing no need to rebind gridview. Only this much is enough grdvwUpdt.PageIndex = e.NewPageIndex;

        K Offline
        K Offline
        kishorg1
        wrote on last edited by
        #3

        still not working ......... :(

        C 1 Reply Last reply
        0
        • K kishorg1

          still not working ......... :(

          C Offline
          C Offline
          chandralekha
          wrote on last edited by
          #4

          You use your earlier code.That is rebind the grid after changing the page index and insert breakpoints .Check whether control is passing correctly or not.

          K 1 Reply Last reply
          0
          • C chandralekha

            You use your earlier code.That is rebind the grid after changing the page index and insert breakpoints .Check whether control is passing correctly or not.

            K Offline
            K Offline
            kishorg1
            wrote on last edited by
            #5

            debugger going inside the event.....but nthing get happen

            B 1 Reply Last reply
            0
            • K kishorg1

              debugger going inside the event.....but nthing get happen

              B Offline
              B Offline
              balaji t
              wrote on last edited by
              #6

              hi, try giving the same code in PageIndexChanging event of grid

              T.Balaji

              K 1 Reply Last reply
              0
              • B balaji t

                hi, try giving the same code in PageIndexChanging event of grid

                T.Balaji

                K Offline
                K Offline
                kishorg1
                wrote on last edited by
                #7

                i have use pageIndexchanging only....

                1 Reply Last reply
                0
                • K kishorg1

                  i have grid view in which i have allow paging.......so i have 10 pages.123456789...n so on to get all pages i hv write the code as follwes. protected void grdvwUpdt_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataTable dsAllUpdtblData = ViewState["dvAllUpdtblData"] as DataTable; grdvwUpdt.PageIndex = e.NewPageIndex; grdvwUpdt.DataSource = dsAllUpdtblData; grdvwUpdt.DataBind(); } when i click on any no ....it dnt show any change.....it must hv to give remaining record...but it didnt shoe tht why?

                  S Offline
                  S Offline
                  sowmya k
                  wrote on last edited by
                  #8

                  Here is the code. You need to create the session of the gridview at the time of binding the data public void BindData() { DataSet dsItemList = objConfig.GetItemList(); grdItemList.DataSource = dsItemList; grdItemList.DataBind(); Session["grd_ItemList"] = dsItemList; } After creating the session use that session in ur page indexchanging method protected void grdItemList_PageIndexChanging(object sender, GridViewPageEventArgs e) { grdItemList.PageIndex = e.NewPageIndex; if (Session["grd_ItemList"] != null) { grdItemList.DataSource = Session["grd_ItemList"]; grdItemList.DataBind(); } Session["grd_ItemList"] = null;//end the session }

                  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