Add buttons to pager

9 posts, 0 answers
  1. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 03 Oct 2010 Link to this post

    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.
  2. Kalin Milanov
    Admin
    Kalin Milanov avatar
    447 posts

    Posted 07 Oct 2010 Link to this post

    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
  3. DevCraft banner
  4. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 15 Oct 2010 Link to this post

    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.
  5. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 15 Oct 2010 Link to this post

    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.

  6. Kalin Milanov
    Admin
    Kalin Milanov avatar
    447 posts

    Posted 20 Oct 2010 Link to this post

    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
  7. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 20 Oct 2010 Link to this post

    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.

  8. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 25 Oct 2010 Link to this post

    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"/>

     


  9. Andrew
    Andrew avatar
    68 posts
    Member since:
    Jul 2010

    Posted 25 Oct 2010 Link to this post

    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">

     

     

  10. Kalin Milanov
    Admin
    Kalin Milanov avatar
    447 posts

    Posted 26 Oct 2010 Link to this post

    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
Back to Top
DevCraft banner