In ASP. NET 2.0,
GridviewControl. The
PagingEasy to use. You can achieve a variety of functions through simple settings in Visual Studio. NET 2005.
PagingFunction.
1. DefaultPagingMethod
(1) permit or notPaging
Gridview.
(2) number of records per page
GridviewPagesize
(3)PagingNavigation bar format
GridviewMode: numeric, nextprevious, nextpreviusfirstlast, numericfirstlast.
2. CustomPaging
(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>