I am using paging on my grid with
I load data into my grid from two different sources so if my pagesize is 20 then it gets max of 10 rows at one time from source1 and same goes for source2.
However, there might be cases when one or both of the source is returning less than 10 rows each.
In that case the number of items in the grid is less than 20.
I want to change the display message of the pager that says 'Displaying page 1 of 2, items 1 to 20 of 25'
I want the 'items 1to 20 of 25' to be changed to 'items 1 to (whatever is the row count for the current page) of 25'
So if page 1 has 15 records then it says 'items 1 to 15 of 25' and then on next page it says items 16 to 25 of 25'
Is there a way to do that?
if not Can I just hide the items part?
Mode
="NextPrev"
I load data into my grid from two different sources so if my pagesize is 20 then it gets max of 10 rows at one time from source1 and same goes for source2.
However, there might be cases when one or both of the source is returning less than 10 rows each.
In that case the number of items in the grid is less than 20.
I want to change the display message of the pager that says 'Displaying page 1 of 2, items 1 to 20 of 25'
I want the 'items 1to 20 of 25' to be changed to 'items 1 to (whatever is the row count for the current page) of 25'
So if page 1 has 15 records then it says 'items 1 to 15 of 25' and then on next page it says items 16 to 25 of 25'
Is there a way to do that?
if not Can I just hide the items part?
5 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 12 Feb 2010, 07:25 AM
Hello,
You can set the format of the text that appears in the Pager (when Mode is "NextPrev") using the PagerTextFormat property. I hope the following link will help in achieveing this.
Using PagerTextFormat
-Shinu.
You can set the format of the text that appears in the Pager (when Mode is "NextPrev") using the PagerTextFormat property. I hope the following link will help in achieveing this.
Using PagerTextFormat
-Shinu.
0

newbie
Top achievements
Rank 1
answered on 16 Feb 2010, 06:41 PM
How can I assign my own value to the pagertext?
I saw a few forum posts but I couldn't figure it out.
Where should i set this in my code behind? I bind my grid whenever user clicks the search button, so that's when i find out how many records are returned.
Could you show me with the help of an example?
I saw a few forum posts but I couldn't figure it out.
Where should i set this in my code behind? I bind my grid whenever user clicks the search button, so that's when i find out how many records are returned.
Could you show me with the help of an example?
0
Hello,
As Shinu already mentioned, you could use the PagerTextFormat property:
Kind regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
As Shinu already mentioned, you could use the PagerTextFormat property:
RadGrid1.PagerStyle.PagerTextFormat =
"{4} Page {0} of {1}, items {2} to {3} of {5} total"
;
Kind regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

newbie
Top achievements
Rank 1
answered on 17 Feb 2010, 08:01 PM
Thanks Daniel, I found that code in the forums as well.
What I meant was where do i assign my own values to this.
Where does the {4},{0},{1}.... values come from and how can i change them?
The problem i am having is to assign them my own values.
RadGrid1.PagerStyle.PagerTextFormat =
"{4} Page {0} of {1}, items {2} to {3} of {5} total"
;
I hope I am making sense here.
Like If my totalrecords are 60 and my page size is 25 but my items on the page are only 20 then instead of shwoing displaying items 1 to 25 of 60 I want to show the text as displaying items 1 to 20 of 60 and on the next page i want to show displaying items 21 to whatever number of items i have that on page of 60
As I explained earlier the reason for doing this is I have my grid data coming from two different sources. I can keep track of the count in my code but I am having trouble reflecting that on the grid.
0
Hello Newbie,
I'm afraid there is no easy way to achieve this using the default pager. Of course, you could use a pager template and show the desired information manually.
Pager Template
Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I'm afraid there is no easy way to achieve this using the default pager. Of course, you could use a pager template and show the desired information manually.
Pager Template
Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.