Is it possible to set the PageSizeText through code when using the RadDataPager for a RadListView?
3 Answers, 1 is accepted
0
Doncho
Telerik team
answered on 28 Apr 2020, 10:26 AM
Hello Stein,
You can use the PageSize property of the RadDatPager to define the page size programmatically. You just need to reference the RadDataPager in the RadListView.
If the RadDataPager is in a template you can try the approach discussed in the Accessing Controls article.
Sample C# code
(RadListView1.FindControl("RadDataPager1") as RadDataPager).PageSize = 5;
I hope that will help.
Kind regards,
Doncho
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.
I am not looking to change the PageSize, but the PageSizeText-property.
0
Doncho
Telerik team
answered on 28 Apr 2020, 10:46 AM
Hi Stein,
I apologize for my inaccurate answer.
Once you have reference to the pager you should reach the PageSize Field and set the desired text by its PageSizeText property, see sample below:
var pager = (RadListView1.FindControl("RadDataPager1") as RadDataPager);
foreach (var field in pager.Fields)
{
if (field is RadDataPagerPageSizeField)
{
(field as RadDataPagerPageSizeField).PageSizeText = "custom Text";
}
}
Kind regards,
Doncho
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.