SetTotalRecords Property?

13 posts, 0 answers
  1. CarlosLima
    CarlosLima avatar
    47 posts
    Member since:
    May 2010

    Posted 29 Jun 2010 Link to this post

    Hi,

    Is there any property that allow us to set the TotalRecords of DataPager ItemSource?

    Regards
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 30 Jun 2010 Link to this post

    Hello David Petronzio,

    Why would you need to set this? This should only be read. The total number of records is equal to the total number of records. That's it. You cannot and most importantly you should not be able to set it directly. For example if you have a collection of 10 records you cannot simply go an tell it that is has 20 records. I hope this makes sense.

    In case you want to "lie" to RadDataPager and tell it what the number of records is you should know that it works with the IPagedCollectionView interface. It is this interface that informs it about things like page size, page index, total item count, etc. So you can control everything by implementing this interface. If you implement this interface, you will be able to "trick" RadDataPager to believe anything, like what the total number of records is. It believes only in this interface.

    Please, take a look at my blog post. I explains everything.

    Let me know if you have any other questions once you have covered it.

    Kind 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
  3. DevCraft banner
  4. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 23 Jul 2010 Link to this post

    Hi David Petronzio,

    A quick follow up. We have decided to log your feature request and call it "Unbound Mode".

    When the pager is in Unbound Mode, i.e. it has no Source defined, you will be able to manually specify the total item count so that the pager can calculate its number of pages. The pager will be fully functional with the only difference that it has no source collection to page. This will allow the developer to use the exiting UI without any efforts. The developer can attach to the PageIndexChanging and PageIndexChanged events of RadDataPager and perfom any kind of action depending on the requirements.

    How does this sound? Will this meet your requirements?

    You can vote for this new feature request here. The PITS ID is 2812.

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

    Posted 28 Jul 2010 Link to this post

    Hi
      I have the same request. Now I use the mode of PagingEndless. But I don't 
    want it endless I want it can be stopped at a particular page which I set by code. Is there a way to achieve this functionality

    THanks
  6. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 29 Jul 2010 Link to this post

    Hello willson,

    Could you please elaborate. What do you mean by stopped at a particular page?

    Best wishes,
    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
  7. willson
    willson avatar
    8 posts
    Member since:
    Jul 2010

    Posted 30 Jul 2010 Link to this post

    Hi telerik

            I want to use the pagingEndless style but I also want to set the maximum number of pages . When the datapager is at the max page (for example at page 10) the next page button should be disabled.

    Thanks
  8. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 02 Aug 2010 Link to this post

    Hi willson,

    I am completely confused now.

    How can something that has a maximum number of pages (end) be endless? Being endless means that you can always click the next page button and get new data. You never know the maximum number of pages because, well, they are endless.

    If you know and define the maximum number of pages then when the last page is reached you will be no longer able to go to the next page. This is the opposite of being endless.

    I hope this makes sense. Something is endless when it does not have an end and you want your endless thing to have and end. I am sorry but I really cannot understand what your goal is.

    You can try to explain it again if you want.

    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
  9. willson
    willson avatar
    8 posts
    Member since:
    Jul 2010

    Posted 03 Aug 2010 Link to this post

    Hi Telerik
              It is what I want to achieve.
             1. I want to partial  load the data. I load data from the web service so I can't load large data at one time.
             2. I know the total recordes of the data. So I need to set the  maximum number of pages.
     
            I found only the endless type can load data partially. What should I do if I want to achieve the two points?
    Thanks
  10. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 04 Aug 2010 Link to this post

    Hello willson,

    As I have already stated in this thread, we are currently working on the "Unbound Mode" of the pager. Here it is again:

    When the pager is in Unbound Mode, i.e. it has no Source defined, you will be able to manually specify the total item count so that the pager can calculate its number of pages. The pager will be fully functional with the only difference that it has no source collection to page. This will allow the developer to use the exiting UI without any efforts. The developer can attach to the PageIndexChanging and PageIndexChanged events of RadDataPager and perfom any kind of action depending on the requirements.

    So, you will set the total amount of records (once the feature is ready). Then each time a PageIndexChanged event occurs -- you will pull only this page from your web service.

    To avoid any further confusion: There is no endless type or mode or whatsoever. This is just an online example. The example demonstrates a possible implementation of IPagedCollectionView. This is is not a feature of the pager. It is just a dummy example. And if you take a closer look at the example -- there absolutely no data. Everything is fake. So long story short -- there is not such thing as endless mode. The pager can either have a real Source or be Unbound (once the feature is ready). When it is Unbound -- you tell it how many pages to display in the UI and then you handle its events and do whatever you like in the event handlers.

    I hope this makes sense.

    Sincerely yours,
    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
  11. willson
    willson avatar
    8 posts
    Member since:
    Jul 2010

    Posted 16 Aug 2010 Link to this post

    Hi Telerik
         I see the Unbound Mode for data pager has been released. But I can't found  guide or lab for this function.
        Can you show me some link to demo this function?
    Thanks 
  12. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 17 Aug 2010 Link to this post

    Hello willson,

    There is nothing special about the Unbound Mode. You simply leave the Pager without specifying any Source, then you are able to manually set the number of items through the ItemCount property. You can do this only when there is no Source. After that you attach to the PageIndexChanged event and do any kind of custom logic.

    We have developed this feature because many of our customers wanted to use the only the UI that RadDataPager provides. They did not want to implement the IPagedCollectionView interface in order to feed it as the Source of the pager. So what we did was -- we allow the developer to manually set the ItemCount if and only if the Source property of the pager is left unassigned. That's all -- it's nothing special.

    Let us know if you have any other questions. We would be glad to help.

    Greetings,
    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
  13. willson
    willson avatar
    8 posts
    Member since:
    Jul 2010

    Posted 17 Aug 2010 Link to this post

    Hi Telerik
            I set the ItemCount property as you say. But it shows an error .
            Error 1 Property or indexer 'Telerik.Windows.Controls.RadDataPager.ItemCount' cannot be assigned to -- it is read only D:\silverlight\BusinessApplication7\BusinessApplication7\Views\Home.xaml.cs 17 13 BusinessApplication7
            I have installed the older version and updated to this new. need I reinstalled the controls again? 
    Thanks
  14. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 18 Aug 2010 Link to this post

    Hi willson,

    What version are you using? You need to upgrade to the latest one, where we introduce this feature.

    All the best,
    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
Back to Top
DevCraft banner