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

[Solved] Retaining Slider in custom PagerTemplate

5 Answers 190 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amir Setoudeh
Top achievements
Rank 1
Amir Setoudeh asked on 27 Aug 2009, 10:37 PM
I have a need to customize the PagerTemplate of my grid.  However, when I add my custom controls to the pager template, I lose the paging slider.  How can I add custom controls, but still retain the slider and its functionality.  I'm basically trying to accomplish this mockup:


http://s977.photobucket.com/albums/ae256/fightclub777/?action=view&current=grid.jpg

5 Answers, 1 is accepted

Sort by
0
Accepted
Mira
Telerik team
answered on 01 Sep 2009, 04:05 PM
Hi Amir,

I suggest that you use PagerTemplate and customize it in the way you want it to look. You may find the following help topics useful:
Setting pager template
Programmatic pager customization

I am also attaching a sample project I made for you where there is a button and a RadSlider in the PagerTemplate and the slider is configured dynamically. Please take a look at it.

Kind regards,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Amir Setoudeh
Top achievements
Rank 1
answered on 01 Sep 2009, 10:16 PM
Mira,

Thank you. That worked perfectly.  I know how to get the "page x of total" to show up, but how can I get the page number (x) to change as the slider handle is dragged around?

Drag the slider around on this example to see what I am talking about:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/slider/defaultvb.aspx


0
Mira
Telerik team
answered on 04 Sep 2009, 02:08 PM
Hi Amir,

In the code I sent you the current page number is kept in the curPage variable. You can access the page number set by the RadSlider also by its Value property - slider.Value.
To achieve the effect as in the demo, please add in the PagerTemplate a label which text you modify when the slider's value is changed.
I am also attaching a modification of the sample project I sent you implementing the desired functionality. Please take a look at it.

All the best,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Amir Setoudeh
Top achievements
Rank 1
answered on 09 Sep 2009, 10:24 PM
Mira,

Thank you for the response... That's not exactly what I was talking about.  I know how to show the current page, but the slider in the demo url I sent changes the text of "x" in "Page x of 10" AS the slider handle is dragged around. NOT after the user makes a selection.  In your example, the label will show the page of the grid is on AFTER the grid changes to that page.  As in the example, I want to show the page that user WILL land on if they release the handle.  Does that make sense?

-Amir
0
Mira
Telerik team
answered on 11 Sep 2009, 11:56 AM
Hello Amir,

To achieve the described functionality I recommend that you handle the OnClientSlide client event of the slider and change the text of the label in its event handler. You can see how it is done in this demo.

Regards,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Amir Setoudeh
Top achievements
Rank 1
Answers by
Mira
Telerik team
Amir Setoudeh
Top achievements
Rank 1
Share this question
or