Geeks With Blogs
Bunch's Blog One day I'll have a catchy subtitle, one day

Recently I ran into an issue where the paging text in a RadGrid control needed to be customizable. In my case I was specifically looking at the "Page size" and "xx items in yy pages" text. Getting around it for the "Page size" was a snap. If your RadGrid is called rgTest one line would do it:

rgTest.PagerStyle.PageSizeLabelText = "your text here";

The "xx items in yy pages" was a bit trickier, but still handled in one line of code.

rgTest.PagerStyle.PagerTextFormat = "{4} {5} things in {1} my pages";

The tricky part was determining which items to use, there are five in total ({1} through {5}). The {4} needs to be first otherwise the rest will not show up. A good guide (but not for my particular situation) is found here.

Tags: ,

Posted on Tuesday, March 6, 2012 3:56 PM | Back to top

Comments on this post: RadGrid PagerStyle in Code Behind

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Bunch | Powered by: | Join free