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

Add buttons to pager

8 Answers 126 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 03 Oct 2010, 03:20 PM
I want to add some control buttons such as close, save, cancel, etc.. to the pager bar (it has some nice real estate free).  How would you go about customizing its template in this way to create these bound buttons.

8 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 07 Oct 2010, 08:32 AM
Hello Andrew,

To do that you will need to do some basic template editing. Attached I am sending you a sample in which the three mentioned buttons are included in the pager. I hope you will like it.

Regards,
Kalin Milanov
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
Andrew
Top achievements
Rank 1
answered on 15 Oct 2010, 06:20 PM
Very cool.  Dumb question, what is the best way to take all the stuff you put under

 

 

 

<UserControl.Resources>

 


and instead put it in a file where all pages can use it.
0
Andrew
Top achievements
Rank 1
answered on 15 Oct 2010, 09:06 PM
I have moved all the resources to app.xaml to make it universally available and simpler to maintain, and that worked, except, I am not sure how to bind the buttons to commands, and where to put the command logic.  It would be best for the command logic to be in the respecitve viewmodel for each view that uses the template.  So the buttons are there, but I am not sure how to use them.

One more question, is there a simple way to add another input box to the datapager bar, which controls the number of rows shown on the grid (per page)? That way the user can change the number of rows to suit their display.

0
Kalin Milanov
Telerik team
answered on 20 Oct 2010, 03:45 PM
Hello Andrew,

There should not be any problem with setting a command in the button even though it is defined in the app.xaml file. 

As for the second part - we are currently working on a feature which will allow you to place the page size in a text box thus giving more control to you users. 

All the best,
Kalin Milanov
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
Andrew
Top achievements
Rank 1
answered on 20 Oct 2010, 03:57 PM
Any timeframe on the new number of rows per page textbox, and is there any chance you could show me a sample of how the commanding would look and where it should be placed so I can move all the stuff back into app.xaml?  I need to setup commands for close, cancel, save, and when they change the number of rows per page (assuming that can be done).

I would really appreciate it if you could show how one would setup the commands either with whatver silverlight comes with or with MVVM light.

0
Andrew
Top achievements
Rank 1
answered on 25 Oct 2010, 11:39 PM
This does not work, but perhaps there is a way to make it work.

 

 

 

<TextBox Margin="2,0" Text="{Binding PageSize, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" SelectionChanged="PageSizeChanged" Width="48" VerticalAlignment="Center"/>

 


I based this on this stuff you did that did work like

<

 

 

TextBlock Margin="2,0" Text="{Binding PageCount, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"/>

 


0
Andrew
Top achievements
Rank 1
answered on 26 Oct 2010, 02:40 AM
There seems to be a flaw in your sample application.  Although it works I get this error in the xaml
Error 1 Type 'controls:RadDataPagerCommands' was not found. F:\Working\223225_353806-extrabuttonsinpager\353806_ExtraButtonsInPager\MainPage.xaml 26 7 353806_ExtraButtonsInPager

Which prevents the designer from working.

What do I need to do to fix this?

The error occurs

 

 

 

<telerik:RadButton Command="controls:RadDataPagerCommands.MoveToFirstPage" Height="18" Margin="2" telerik:StyleManager.Theme="{StaticResource Theme}" Visibility="{Binding PagerControlsVisibility.MoveToFirstPageControlVisibility, RelativeSource={RelativeSource TemplatedParent}}" Width="18">

 

 

0
Kalin Milanov
Telerik team
answered on 26 Oct 2010, 07:37 AM
Hi Andrew,

Reading your posts it seems there are a lot of things happening in the pager which combined are giving you hard time. Could you please send me some description and / or mockup of what are you trying to accomplish in your app so I can be of real assistance. 

As far as I understand you want to have the additional buttons in the pager which requires template editing, take the style and the template in the app.xaml file and use the commands to do add / edit / delete in an items control (GridView, ListBox, etc.). Did I get it right?

All the best,
Kalin Milanov
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
Tags
DataPager
Asked by
Andrew
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or