Customizing the pager custom page

Source: Internet
Author: User
ArticleDirectory
    • Pager appearance
    • Pager templates

If paging is enabled, R. A.D.GridWill render pager item (s) (gridpageritem) on the top and/or bottom of each gridtableview displayed in the hierarchy.

Pager appearance

the appearance of the pager item can be controlled using gridtableview. pagerstyle property. as most of appearance options, pagerstyle of each gridtableview can be predefined using radgrid. pagerstyle property-This wocould apply to all gridtableviews in the hierarchy unless specified other for a certain table-view.
as pagerstyle extends the tableitemstyle class the settings cocould apply to item's fore-color, back-color , border style , font etc. gridpagerstyle provides also properties to control the position of the items 'pagerstyle. position- top , bottom or topandbottom and type of pager buttons that appear.

The pager buttons allow the user to navigate through the pages-change the display page by settingNextOrPreviousOr use a page number to directly switch page. use gridtableview. pagerstyle. mode property to control the mode pager buttons wocould be display and wocould function. use gridpagermode. numericpages to display a button for each page with the corresponding page number. use gridpagermode. prevnext to specify that only buttonsPrevious/NextPage wocould appear.

All properties controlling paging behavior can be set using either Development Environment designers or programmatically. The values set persistence are persisted into the view-State providing consistency in Grid's page navigation and define their use.

If you use any other button (s) to control paging in R. A.D.GridIn a custom manner, you can use command button (s) with commandname 'page' and commandargument'Next','Prev', Or a number of any page-ex. commandargument = "42 ".

Pager templates

Pager item can use templates for setting its appearance and features. All command buttons in the template can take advantage of the command API. For example a buttonCommandname"Page" andCommandargumentOf "last" will force R. A.D.GridTo go to the last page when clicked. No additional code is necessary.

Using declarative binding expressions command buttons in the pager can control their visibility based on various paging-related properties provided by the pageritem. Paging instance.

 

<Pagertemplate>
<Table border = "0" cellpadding = "5" Height = "18px" width = "100%">
<Tr>
<TD style = "border-style: none;">
<Asp: linkbutton id = "linkbutton1" commandname = "page" causesvalidation = "false" commandargument = "first" runat = "server"> first </ASP: linkbutton>
</TD>
<TD style = "border-style: none;">
<Asp: linkbutton id = "linkbutton5" commandname = "page" causesvalidation = "false" commandargument = "Prev" runat = "server"> Prev </ASP: linkbutton>
</TD>
<TD style = "border-style: none;">
<Asp: textbox id = "tbpagenumber" runat = "server" columns = "3" text = '<% # (INT) databinder. eval (container, "ownertableview. currentpageindex ") + 1%> '/>
<Asp: rangevalidator runat = "server" id = "rangevalidator1" controltovalidate = "tbpagenumber" enableclientscript = "true" minimumvalue = "1"
Type = "integer"
Maximumvalue = '<% # databinder. eval (container, "Paging. pagecount") %>'
Errormessage = '<% # "value must be in the range of 1-" + databinder. eval (container, "Paging. pagecount") %>'
Display = "dynamic"> </ASP: rangevalidator>
</TD>
<TD style = "border-style: none;">
<Asp: linkbutton id = "linkbutton4" runat = "server" commandname = "customchangepage"> go </ASP: linkbutton>
</TD>
<TD style = "border-style: none;">
<Asp: linkbutton id = "linkbutton3" commandname = "page" causesvalidation = "false" commandargument = "Next" runat = "server"> next </ASP: linkbutton>
</TD>
<TD style = "border-style: none;">
<Asp: linkbutton id = "linkbutton2" commandname = "page" causesvalidation = "false" commandargument = "last" runat = "server"> last </ASP: linkbutton>
</TD>
<TD style = "border-style: none; width: 100%" align = "right">
<Asp: linkbutton id = "linkbutton6" commandname = "rebindgrid" causesvalidation = "false" runat = "server"> refresh data </ASP: linkbutton>
</TD>
</Tr>
</Table>
</Pagertemplate>

 

Commandname

Commandargument

Description

Page First Goes to the first page
Page Last Goes to the last page
Page An integer ("5" for example) Go to the specified page
Page Next Goes to the next page
Page Previous Goes to the previous page

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.