Jump to desired pageindex using DataPagerTextBox when data loaded dynamically

2 posts, 1 answers
  1. Dipika
    Dipika avatar
    11 posts
    Member since:
    Sep 2012

    Posted 04 Jul 2013 Link to this post

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

  2. Answer
    Rossen Hristov
    Rossen Hristov avatar
    2478 posts

    Posted 08 Jul 2013 Link to this post


    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.

    Rossen Hristov
    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 >>
Back to Top