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

Jump to desired pageindex using DataPagerTextBox when data loaded dynamically

1 Answer 22 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Dipika
Top achievements
Rank 1
Dipika asked on 04 Jul 2013, 06:58 PM
Hi,
In my application on click of next button, I am calling service (Input as : pageindex and DataitemCount=50 ) which brings 50 records for that pageindex and totalpage count( i.e. Total number of pages present in database in bunch of 50).Because of that, dynamic data with appropriate pageindex get loaded on click of next page. But here problem I am getting when I want to jump from current pageindex to some other pageindex whose service is yet to call through DataPagerTextBox. for example If I have 10 pages record at server side and loaded 5 of them by clicking next 5 times and now suppose if I want to jump on 7th page(through DataPagerTextBox) then I need to call service for that pageindex, But I am not getting any event/property in DataPagerTextBox so that on click of enter key service get called and load page 7. Can u please provide me how we can achieve that as here it takes total page count as loaded data only ?
Please get me back if you not understand..

Thanks,
Dipika 

1 Answer, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 08 Jul 2013, 08:09 AM
Hi,

I assume that you are using RadDataPager in its Unbound Mode since you are pulling the data by hand instead of binding the pager to a source implementing the IPagedCollectionView interface which is the standard Silverlight interface for paging operations. 

Just like the stock Silveright DataPager (both pagers are 100% identical in terms of API), RadDataPager provides two events -- PageIndexChanging (which is cancelable) and PageIndexChanged. You can use those two events to detect what the user is doing. You don't have to rely on UI elements such as the TextBox. Business logic and UI should not be mixed. The event arguments of those two events carry all available information, which in this case is the page index the user wants to go to. That is all in terms of API that RadDataPager offers.

You other option is to bind the pager to something that implements the IPagedCollectionView interface. It will play nicely with it and call its respective methods.

I hope this helps.

Regards,
Rossen Hristov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
DataPager
Asked by
Dipika
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or