Feed on
Subscription

Contact ASP.Net(12 intimately)

The cent page of DataGrid (2)

Here I am back-to-back on one,The cent page that tells DataGrid.Going up in the exemple,We can see to cent the page is controlled,Original already enough,Breathe out ah,But it is a common cent page only,Do not have a meaning more,Still change to it some of variety is nice.Tell the attribute that tells a DataGrid to accuse a place to use first

%26lt;ASP:DAtaGrid Id= "DataGrid1" Runat= "server "
AllowPaging= "True "
PageSize= "5 "
PagerStyle-HorizontalAlign= "Right "
BorderColor= "black "
BorderWidth= "1 "
GridLines= "Both "
CellPadding= "3 "
CellSpacing= "0 "
Font-Name= "Verdana "
Font-Size= "8pt "
HeaderStyle-BackColor= "#aaaadd "
AlternatingItemStyle-BackColor= "#eeeeee "
/ %26gt;
About its attribute,Some were not told look to know.A few are told here fresh:)

HeaderStyle-BackColor is the color that points to Column column

AlternatingItemStyle-BackColor is to point to lie between the color that appears alternately all right

These we are going up had seen in the section.Below my retell a few attribute.

We look at that %26quot;%26lt;%26quot; and %26quot;%26gt;%26quot; not pleasing to the eye,We want to change them into " of below " of on " one page and " one page, very good do,Join two attribute

PagerStyle-NextPageText= " issues one page "
On PagerStyle-PrevPageText= " one page "

We look again:



Graph 12 - 1

How,Changed:)

We still cannot bear the sight of,It is much better to if use these 123 numbers,label.Also go.Increase property again.

PagerStyle-Mode= "NumericPages "

Look again:



Graph 12 - 2

Do calm.

If can show altogether has how many page,And still can report it is the a fewth page currently,That much better:) ,Also go,Not be to changed attribute to be able to be accomplished nevertheless.We add the code of fluctuation face

Current page is:%26lt;font Color=red%26gt;%26lt;%=DataGrid1.CurrentPageIndex+1%%26gt;%26lt;/font%26gt;%26lt;br%26gt;
Total page number is:%26lt;font Color=red%26gt;%26lt;%=DataGrid1.PageCount%%26gt;%26lt;/font%26gt;%26lt;br%26gt;

Look again:



OK.Breathe out ah,The link that some friends still need to join " of " end page and " of " home page,This also is possible,Want nevertheless complex much.

Too late,We next time retell.Basically be use OnPageIndexChanged incident.Breathe out ah,The friend that have fun at can be done first:)

 
Related:

    Submit: