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 in gridview?

paging in gridview?

Scheduled Pinned Locked Moved ASP.NET
csscomsysadminhelpquestion
2 Posts 1 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
    murali_utr
    wrote on last edited by
    #1

    hi, In my project using gridview and handling paging. paging is not working for me. there is not error raised in pageindexchanging. following is my gridview. whats the thing need to write in grdcountry_pageindexchanging. Any sample code please. vert urgent please <asp:GridView ID="grdCountry" runat="server" AutoGenerateColumns="False" BorderWidth="1px" CellPadding="5" CssClass="Grid" DataKeyNames="pk_country_id" ForeColor="#284E98" GridLines="Vertical" Width="50%" PageSize="25" AllowPaging="True" AllowSorting="True" onpageindexchanging="grdCountry_PageIndexChanging" EnableSortingAndPagingCallbacks="True"> <PagerSettings Mode="NextPreviousFirstLast" position="Bottom" pagebuttoncount="10"/> <pagerstyle backcolor="LightBlue"/> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:BoundField DataField="country_name" HeaderText="Country Name"> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:CommandField ButtonType="Button" ShowCancelButton="False" ShowSelectButton="True" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView>

    Have A Nice Day! Murali.M Blog

    M 1 Reply Last reply
    0
    • M murali_utr

      hi, In my project using gridview and handling paging. paging is not working for me. there is not error raised in pageindexchanging. following is my gridview. whats the thing need to write in grdcountry_pageindexchanging. Any sample code please. vert urgent please <asp:GridView ID="grdCountry" runat="server" AutoGenerateColumns="False" BorderWidth="1px" CellPadding="5" CssClass="Grid" DataKeyNames="pk_country_id" ForeColor="#284E98" GridLines="Vertical" Width="50%" PageSize="25" AllowPaging="True" AllowSorting="True" onpageindexchanging="grdCountry_PageIndexChanging" EnableSortingAndPagingCallbacks="True"> <PagerSettings Mode="NextPreviousFirstLast" position="Bottom" pagebuttoncount="10"/> <pagerstyle backcolor="LightBlue"/> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:BoundField DataField="country_name" HeaderText="Country Name"> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:CommandField ButtonType="Button" ShowCancelButton="False" ShowSelectButton="True" /> </Columns> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#2461BF" /> <AlternatingRowStyle BackColor="White" /> </asp:GridView>

      Have A Nice Day! Murali.M Blog

      M Offline
      M Offline
      murali_utr
      wrote on last edited by
      #2

      thanks to all. i got the solution for this problem.

      protected void grdCountry_PageIndexChanging(object sender, GridViewPageEventArgs e)
      {
      try
      {
      grdCountry.PageIndex = e.NewPageIndex;
      LoadCountryGrid();
      }
      catch (Exception ex)
      {
      ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "HOSPMS", "alert('" + ex.Message + "!')", true);
      }
      }

      Have A Nice Day! Murali.M Blog

      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