I am trying to use a numeric pager on both the top and bottom of a Radgrid and align the pager all the way to the right side of the grid. I am able to get the pager to be numeric and be placed on the top and the bottom of the grid, but am unable to move the pager from the left side to the right side.
I have tried using:
PagerStyle-HorizontalAlign="Right" PagerStyle-Mode="NumericPages" PagerStyle-Position="TopAndBottom"
in the <telerik:RadGrid tag,
as well as
<PagerStyle Mode="NumericPages" Position="TopAndBottom" HorizontalAlign="Right" />
and in the codebehind as
RadGrid.PagerStyle.Position =
GridPagerPosition.TopAndBottom;
RadGrid.PagerStyle.Mode =
GridPagerMode.NumericPages;
RadGrid.PagerStyle.HorizontalAlign =
HorizontalAlign.Right;
in each instance the numeric pager appears at the top and bottom of the grid, but is left aligned. I also do not receive any errors at all. What do I need to do differently in order to move the numeric pager from the left side of the grid to the right?
Thank you for any help that I may receive.
Aaron
5 Answers, 1 is accepted
You can set the Css class for the PagerItem and set styles in the class as shown below:
c# :
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridPagerItem) |
{ |
GridPagerItem pagerItem = (GridPagerItem)e.Item; |
pagerItem.CssClass = "pager"; |
} |
} |
CSS :
<style type="text/css"> |
.pager |
{ |
padding-left:95%; |
} |
</style> |
Thanks
Princy.
It didn't help me to align it left. I followed your code and my existing aspx for PagerStyle -
<
telerik:RadGrid .....
PagerStyle-AlwaysVisible
="true" FooterStyle-HorizontalAlign="Left" >
<PagerStyle Mode="NextPrevAndNumeric" ShowPagerText="false" />
PLEASE HELP ME TO GET IT LEFT ALIGNED.
Thanks,
Arif
I tried setting the PagerStyle-Mode as you have shown above and it is left aligned by default. And also the above given code snippet is to right align the Pager. You may try the following code snippet to left align the Grid pager.
CS:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridPagerItem) |
{ |
GridPagerItem pagerItem = (GridPagerItem)e.Item; |
pagerItem.CssClass = "MyPager"; |
} |
} |
Style.Css:
<title>Untitled Page</title> |
<style type="text/css"> |
.MyPager |
{ |
padding-right:70%; |
} |
</style> |
Regards
Shinu
Did anyone ever figure out how to align all the pager items to the left? Our grid has the pager on the left and count # of pages on right so annoying when its a very wide grid.
I tried using all the approaches above with no luck.
The closest I got was using this but it makes the combobox page selector out of whack.
.RadGrid_WebBlue .rgPager div |
{ |
float:left !important; |
} |
Please Help.
Thanks.
Some similar post here, but how to align the info message left, and the pager elements to the right.... and have everything in the correct order.
https://www.telerik.com/forums/grid-pager-style#BKlQxTrrb0SOiXskH8kTMw