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. Paging

Paging

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

    I am using Visual Studio.NET 2003. i am using datagrid. i want paging to be done in datagrid. i was able to display the 2 records per page.But was not able to go to the second page.How to read the second page.

    Mohinder Singh

    S 1 Reply Last reply
    0
    • V vengaqua

      I am using Visual Studio.NET 2003. i am using datagrid. i want paging to be done in datagrid. i was able to display the 2 records per page.But was not able to go to the second page.How to read the second page.

      Mohinder Singh

      S Offline
      S Offline
      siddisagar
      wrote on last edited by
      #2

      Properties: or Add in Html code AllowPaging : True. PageSize="3" then Use this code in codebehind: --------------------------------- you have to write code in this Event. DataGrid1_PageIndexChanged(): DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() if u have any doubts then ask again

      V 1 Reply Last reply
      0
      • S siddisagar

        Properties: or Add in Html code AllowPaging : True. PageSize="3" then Use this code in codebehind: --------------------------------- you have to write code in this Event. DataGrid1_PageIndexChanged(): DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() if u have any doubts then ask again

        V Offline
        V Offline
        vengaqua
        wrote on last edited by
        #3

        what is dsobj This is what i am doing to pop the records in the grid. Now tell me what to do now. Dim AddDetComm As New SqlCommand("Address_Book_Details", ABCon.Siteconnection) AddDetComm.CommandType = CommandType.StoredProcedure Dim AddDetada As New SqlDataAdapter(AddDetComm) AddDetada.Fill(AddDetDataset) AddressGrid.DataSource = AddDetDataset AddressGrid.DataBind()

        Mohinder Singh

        V 1 Reply Last reply
        0
        • V vengaqua

          what is dsobj This is what i am doing to pop the records in the grid. Now tell me what to do now. Dim AddDetComm As New SqlCommand("Address_Book_Details", ABCon.Siteconnection) AddDetComm.CommandType = CommandType.StoredProcedure Dim AddDetada As New SqlDataAdapter(AddDetComm) AddDetada.Fill(AddDetDataset) AddressGrid.DataSource = AddDetDataset AddressGrid.DataBind()

          Mohinder Singh

          V Offline
          V Offline
          vengaqua
          wrote on last edited by
          #4

          hey dear friends please help me out it is not working. i am working on asp.net 2003.

          Mohinder Singh

          S 1 Reply Last reply
          0
          • V vengaqua

            hey dear friends please help me out it is not working. i am working on asp.net 2003.

            Mohinder Singh

            S Offline
            S Offline
            siddisagar
            wrote on last edited by
            #5

            "dsObj" means Dataset object.Pls find the code below follow these steps then u willn't get any problem. 1.Modify connectionString 2.Place u r storedprocedure or Query in place of my Query 3.Fire DataGri1_PageIndexed Change Event and paste my code if u still get any prob then ask me again.This code is working here. .VB(CodeBehind) -------------- Dim conObj As New SqlConnection Dim adpObj As New SqlDataAdapter Dim dsObj As New DataSet Page_Load() ----------- Try conObj = New SqlConnection("Data Source=B4B-2F-323-CK26;user id=sa;password=sa;Database=TEST") conObj.Open() adpObj = New SqlDataAdapter("SELECT * FROM Login", conObj) adpObj.Fill(dsObj, "Login") DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() Catch ex As Exception Response.Write(ex.ToString()) End Try DataGrid1_PageIndexChanged() ---------------------------- DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() This will definitly helpful for u Bye :laugh:

            S 1 Reply Last reply
            0
            • S siddisagar

              "dsObj" means Dataset object.Pls find the code below follow these steps then u willn't get any problem. 1.Modify connectionString 2.Place u r storedprocedure or Query in place of my Query 3.Fire DataGri1_PageIndexed Change Event and paste my code if u still get any prob then ask me again.This code is working here. .VB(CodeBehind) -------------- Dim conObj As New SqlConnection Dim adpObj As New SqlDataAdapter Dim dsObj As New DataSet Page_Load() ----------- Try conObj = New SqlConnection("Data Source=B4B-2F-323-CK26;user id=sa;password=sa;Database=TEST") conObj.Open() adpObj = New SqlDataAdapter("SELECT * FROM Login", conObj) adpObj.Fill(dsObj, "Login") DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() Catch ex As Exception Response.Write(ex.ToString()) End Try DataGrid1_PageIndexChanged() ---------------------------- DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() This will definitly helpful for u Bye :laugh:

              S Offline
              S Offline
              siddisagar
              wrote on last edited by
              #6

              http://www.dotnetspider.com/kb/Article3011.aspx[^]

              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