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

PageSize drop down into RadDataPager

7 Answers 221 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Alessandro
Top achievements
Rank 1
Alessandro asked on 06 Dec 2010, 09:52 AM
Hello,
I'm working with RadDataPager and RadGridView. All works fine.
I would like to customize the RadDataPager and add a DropDown with some fixed page sizes.
So the user can choice if he wants to show 10, 20, 50 or 100 items in the page.

Is it possibile to do this? Do you have an example?

Thanks.
Alessandro

7 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 07 Dec 2010, 12:16 PM
Hello Alessandro,

You will need to edit the control template of the pager, place your custom control somewhere inside the DataPagerPresenter, and Bind its Value property to the PageSize. You will need the Latest Internal Build version in order to do this.

I hope this helps.

Greetings,
Ross
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Justin
Top achievements
Rank 1
answered on 09 May 2011, 03:57 PM
Telerik, Are there any plans to build this feature into the control?  If not, just curious as to why? I don't want to spend the time to customize the template if you already know that there are issues doing so.

Thanks
0
Rossen Hristov
Telerik team
answered on 09 May 2011, 04:57 PM
Hi Justin,

We don't have plans to add such a feature, since we don't consider this to be a feature at all. We can do it for around 5 minutes, but we don't think that it is right. Let me try to explain why.

In the XAML plartorms WPF and Silverlight, there are two extremely powerful features called Control Templates and Data Binding. With the help of these two features, you can alter the appearance and functionality of any control in an infinite number of ways.

For example, you can add a combo-box in RadDataPager's template and bind its SelectedValue to the PageSize property of the control. Or you can add a TextBox. Or a RadNumericUpDown. Or a RadSlider that will change the PageSize when the user slides left and right. In fact, you can add any kind of control and bind it to the PageSize property. Why limit your choice to a combo? You personally want a combo, but another customer can place a slider, since he likes sliders better. Which one should we add out-of-the-box as a feature? The answer is none. It is not that we cannot. It's around 5 lines of XAML and is pretty easy. It is because, we can't decide what is best for everyone.

If we decide to add a combo that you will show up when you turn on a single boolean property, what page sizes should it offer? "5, 10, 20, 100" or "10, 50, 150"? Should it be on the left side or on the right side? Should it be pink, yellow or brown? How many items should it have? Why not a RadSlider instead of the combo? I believe that you see where I am getting at.

Since everyone out there will have a specific personal requirement -- he or she can easily achieve it with a few lines of XAML. That's the whole beauty of the Silverlight platform. 

We have exposed the PageSize property and everyone out there can bind it to anything that he wants. Thus everyone is happy. It's not that we can't add such a feature, in fact we have already created such a project in the code library that my colleague mentioned, we simply don't believe that this is the right thing to do just for the reasons I have explained above. You are watching from your tower and you want a combo, but other people may want a, let's say RadNumericUpDown, which is on the left size of the pager and is green. We can't add a separate "feature" for every one. That's why XAML, Visual Studio and Expression Blend exist -- there is the PageSize property -- go ahead and define the UI that will bind to it.

I really hope that I was able to explain all of these. Let me know if I could not.

All the best,
Ross
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
Rossen Hristov
Telerik team
answered on 09 May 2011, 04:59 PM
Hello Justin,

I forgot the link to the code-library:

http://www.telerik.com/community/code-library/silverlight/datapager/dynamically-change-the-pagesize-of-raddatapager.aspx

I hope this helps.

Kind regards,
Ross
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
Michael MSTG
Top achievements
Rank 1
answered on 20 May 2011, 07:32 PM
I posted this on that thread:

What would be the best approach if I wanted to put this into a resource dictionary so I could use this style across multiple data pagers?

What I'm looking for is to somehow know what the drop down selected and to know the source binding of that data pager since 99% of the time I'd be using this in a DomainDataSource scenario and the page size would be set there, not on the pager.
0
Dempsey
Top achievements
Rank 1
answered on 09 Dec 2012, 08:34 AM
I'm confused, Ross. Didn't Telerik do exactly what Alessandro is asking for in your AJAXcontrols? See this page to see why I'm confused.

http://www.telerik.com/help/aspnet-ajax/datapager-elements.html

Also, there's a difference in choosing to please no one versus choosing to please the most likely (or most asked for) capability, along with still providing means to other people to get what they want using methods they would have had to use anyway.
Just wondering...

Thanks.
(Regardless, that was a good, detailed answer you gave, so thank you.)
Dempsey
0
Doug
Top achievements
Rank 1
answered on 16 Oct 2013, 05:27 PM
I am new to WPF and would like to a a dropdown box to the RadDataPager. I read and agree with your explanation about why it is not a standard control inside of the RadDataPager. What I am looking for is an example of how to accomplish getting the dropdown inside the RadDataPager. Everything I see looks like they are writing a template for the entire RadDataPager. You indicated this would just be a few lines of xaml. Please help.

Thanks ~Doug
Tags
DataPager
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Justin
Top achievements
Rank 1
Michael MSTG
Top achievements
Rank 1
Dempsey
Top achievements
Rank 1
Doug
Top achievements
Rank 1
Share this question
or