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

RadDataPager custom template

7 Answers 92 Views
GridView
This is a migrated thread and some comments may be shown as answers.
boris
Top achievements
Rank 1
boris asked on 13 Apr 2010, 03:00 PM
Hello,
I need to  change the look of RadDataPager, instead of buttons my pager needs to have slider  :S
Can I somehow create custom template with a slider control that would be used for navigating pages?

7 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 14 Apr 2010, 01:40 PM
Hello boris,

Please use the following xaml as starting point.
<ControlTemplate TargetType="telerik:RadDataPager" x:Name="MySliderPagerTemplate" >
                <controls:RadSlider Value="{Binding PageIndex,  RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" IsSnapToTickEnabled="True" Minimum="1" Maximum="{Binding PageCount,  RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" TickFrequency="1" Width="100"/>
            </ControlTemplate>

In case you have troubles implementig this , just let me know.

Greetings,
Pavel Pavlov
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
boris
Top achievements
Rank 1
answered on 19 Apr 2010, 01:00 PM
Hello Pavel,
Thank you for your reply, it has been very helpful. 
I have just one problem with this- when I use the "<" and ">" buttons on the side of the slider, value property doesn't update :(
0
Pavel Pavlov
Telerik team
answered on 19 Apr 2010, 01:02 PM
Hello boris,

Please paste me your solution and I will try to link the buttons to the proper datapager commands.

Kind regards,
Pavel Pavlov
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
boris
Top achievements
Rank 1
answered on 20 Apr 2010, 08:18 AM
Hi Pavel, sorry for a late response :(
My mistake, I had some bugs, but that is sorted. The thing is I was trying to use slider in my custom pager control (I am also implementing some server side paging..) 
Today, I will try to implement telerik data pager using the template as you described, and I'll let you know how it goes.
thanks again :)
0
boris
Top achievements
Rank 1
answered on 26 Apr 2010, 09:53 AM
Hi Pavel,
I am having some trouble with pager control, I have created a demo application to demonstrate it.
ticket ID is : 303857

I am trying to bind a pager to "Items" property of the grid controls as described here:
Some of the stuff that is specific to my example:
- I have to add pager dynamically, so the binding is set dynamically as well, 
- I am using customTemplate for my pager that has slider and stuff.

The problem is when the pager is added, it is not bound to the Items propery at all.....
0
Accepted
Rossen Hristov
Telerik team
answered on 26 Apr 2010, 10:05 AM
Hello boris,

It appears that you cannot have an element name binding before the element is added to the visual tree. It seems that the framework does not update the binding when you add the element later. So you need to bind them directly like this:

CustomPager pager = new CustomPager();
            pager.PageSize = 3;
            pager.Source = radGridView1.Items;
            LayoutRoot.Children.Add(pager);

I hope this helps.

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
boris
Top achievements
Rank 1
answered on 26 Apr 2010, 10:27 AM
Hello Ros,
Indeed that helped :)
Thanks a lot!
Tags
GridView
Asked by
boris
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
boris
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or