This is a migrated thread and some comments may be shown as answers.

[Solved] PagerTextFormat Parameters show "null"

7 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 23 Jan 2013, 09:01 PM
I am trying to localize my text in the pager of my RadGrid.

<PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" PagerTextFormat="{0} {1} {2} {3} {5} records {4} " />

But what displays is "null records" with the controls to the right.

What might be causing this?

7 Answers, 1 is accepted

Sort by
0
Josh
Top achievements
Rank 1
answered on 23 Jan 2013, 09:04 PM
In addition I tried to set the text in the ItemDataBound event handler

radGrid.MasterTableView.PagerStyle.PagerTextFormat = pager.Paging.DataSourceCount + " records {4}";

However, I still see "null records" with the controls to the right.
0
Shinu
Top achievements
Rank 2
answered on 24 Jan 2013, 04:27 AM
Hi,

I am not quite sure about your scenario. You can set the PagerTextFormat depending on the mode as explained in the following documentation.
Using PagerTextFormat

Thanks,
Shinu
0
Josh
Top achievements
Rank 1
answered on 24 Jan 2013, 02:51 PM
Shinu,

Should PagerTextFormat="{5} records {4} " produce the string "null records" when displayed in the browser?


0
Kostadin
Telerik team
answered on 29 Jan 2013, 11:43 AM
Hello Josh,

Note that the '{4}' parameter is mandatory and should be positioned on the left. For instance
PagerTextFormat="{4} records {5} "

Kind regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Josh
Top achievements
Rank 1
answered on 30 Jan 2013, 02:47 PM
I changed PagerTextFormat to "{4} records {5} ". I get the same result. I've attached a screenshot.
0
Accepted
Pavlina
Telerik team
answered on 04 Feb 2013, 02:13 PM
Hello Josh,

I tried to replicate the problem you are facing with PagerTextFormat property in sample runnable project, but to no avail. Find attached my test page and see what is the difference in your case.

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Josh
Top achievements
Rank 1
answered on 04 Feb 2013, 03:17 PM
Same result. However, I found the problem.

Someone was using some javascript to find and replace the text that should appear. The js was searching for "strong". However, when I used the PagerTextFormat, I had replaced

"Change page: {4} &nbsp;Page <strong>{0}</strong> of <strong>{1}</strong>, items <strong>{2}</strong> to <strong>{3}</strong> of <strong>{5}</strong>.Change page: {4} &nbsp;Page <strong>{0}</strong> of <strong>{1}</strong>, items <strong>{2}</strong> to <strong>{3}</strong> of <strong>{5}</strong>." 

with "{4} {5} records". The js was returning the text "null records".

Sorry for the run around and thanks for all the help.
Tags
Grid
Asked by
Josh
Top achievements
Rank 1
Answers by
Josh
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Kostadin
Telerik team
Pavlina
Telerik team
Share this question
or