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. grid view paging problem. when i use paging it not give proper result..

grid view paging problem. when i use paging it not give proper result..

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

    public void grdbind() { try { con.Open(); SqlDataAdapter adp = new SqlDataAdapter("select UM_VC50_UserId,UM_IN4_Address_No_FK,UM_VC50_Role from T060011", ConfigurationManager.ConnectionStrings["cn2"].ConnectionString); DataTable dt = new DataTable(); adp.Fill(dt); grd_detail.DataSource = dt; grd_detail.DataBind(); // int gridID = 0, dtID = 0; Int32 i; for (i = 0; i < grd_detail.Rows.Count; i++) { // //dtID = Convert.ToInt32(dt.Rows[i]["UM_IN4_Address_No_FK"]); // for (int GridRowCount = 0; i < grd_detail.Rows.Count; GridRowCount++) // { // gridID = Convert.ToInt32(((Label)(grd_detail.Rows[GridRowCount].Cells[1].FindControl("lbl_sr"))).Text); // if (dtID == gridID) string role = dt.Rows[i][2].ToString(); if (role == "A") { CheckBox chk = new CheckBox(); chk = ((CheckBox)grd_detail.Rows[i].Cells[0].FindControl("chk1")); chk.Checked = true; } } } catch (Exception ex) { } }

    K 1 Reply Last reply
    0
    • A anujbanka1784

      public void grdbind() { try { con.Open(); SqlDataAdapter adp = new SqlDataAdapter("select UM_VC50_UserId,UM_IN4_Address_No_FK,UM_VC50_Role from T060011", ConfigurationManager.ConnectionStrings["cn2"].ConnectionString); DataTable dt = new DataTable(); adp.Fill(dt); grd_detail.DataSource = dt; grd_detail.DataBind(); // int gridID = 0, dtID = 0; Int32 i; for (i = 0; i < grd_detail.Rows.Count; i++) { // //dtID = Convert.ToInt32(dt.Rows[i]["UM_IN4_Address_No_FK"]); // for (int GridRowCount = 0; i < grd_detail.Rows.Count; GridRowCount++) // { // gridID = Convert.ToInt32(((Label)(grd_detail.Rows[GridRowCount].Cells[1].FindControl("lbl_sr"))).Text); // if (dtID == gridID) string role = dt.Rows[i][2].ToString(); if (role == "A") { CheckBox chk = new CheckBox(); chk = ((CheckBox)grd_detail.Rows[i].Cells[0].FindControl("chk1")); chk.Checked = true; } } } catch (Exception ex) { } }

      K Offline
      K Offline
      keyur satyadev
      wrote on last edited by
      #2

      make the gridview paging property true and write fire the event of grid view paging. or follow the code. eg. { protected void grdemp_PageIndexChanging(object sender, GridViewPageEventArgs e) //grdemp is ame of grid view { grdemp.PageIndex = e.NewPageIndex; } } Regards Keyur Satyadev

      A 1 Reply Last reply
      0
      • K keyur satyadev

        make the gridview paging property true and write fire the event of grid view paging. or follow the code. eg. { protected void grdemp_PageIndexChanging(object sender, GridViewPageEventArgs e) //grdemp is ame of grid view { grdemp.PageIndex = e.NewPageIndex; } } Regards Keyur Satyadev

        A Offline
        A Offline
        anujbanka1784
        wrote on last edited by
        #3

        i did that the problem is not that .. i have solved it but thnx for response.

        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