This control provides convenient paging. You can implement various paging functions by simply setting Visual Studio. NET 2005.
1. Default paging Mode
(1) Whether paging is allowed
The allowpaging attribute of the gridview.
(2) number of records per page
Pagesize of the gridview
(3) pagination navigation bar
The mode of the pagersettings attribute of the gridview: numeric, nextprevious, nextpreviusfirstlast, and numericfirstlast.
2. Custom Paging
(1) Current page
<Asp: Label id = "labelcurrentpage" runat = "server"
TEXT = "<% # (gridview) container. namingcontainer). pageindex + 1%>"> </ASP: Label>
(2) Total number of pages <asp: Label id = "labelpagecount" runat = "server"
TEXT = "<% # (gridview) container. namingcontainer). pagecount %>"> </ASP: Label>
(3) homepage, Previous Page, next page, and last page <asp: linkbutton id = "linkbuttonfirstpage" runat = "server" commandargument = "first" commandname = "page"
Visible = "<% # (gridview) container. namingcontainer). pageindex! = 0%> "> homepage </ASP: linkbutton>
<Asp: linkbutton id = "linkbuttonpreviouspage" runat = "server" commandargument = "Prev" commandname = "page"
Visible = "<% # (gridview) container. namingcontainer). pageindex! = 0%> "> previous page </ASP: linkbutton>
<Asp: linkbutton id = "linkbuttonnextpage" runat = "server" commandargument = "Next" commandname = "page"
Visible = "<% # (gridview) container. namingcontainer). pageindex! = (Gridview) container. namingcontainer). pagecount-1%> "> next page </ASP: linkbutton>
<Asp: linkbutton id = "linkbuttonlastpage" runat = "server" commandargument = "last" commandname = "page"
Visible = "<% # (gridview) container. namingcontainer). pageindex! = (Gridview) container. namingcontainer). pagecount-1%> "> last page </ASP: linkbutton>
Note: Write the preceding custom code in the <pagertemplate> </pagertemplate> label of the gridview.