"Total # of Pages" in the book question

6 posts, 1 answers
  1. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 08 Dec 2009 Link to this post

    Hi Kiril;

    I would like to ask you the following question. Let's say we bind a RADBook to a set of collection of objects that were returned from RIA services. And we are using ItemsTemplate to layout the data. However, I want to create a set of navigation buttons for the book to go First, Last, Prev. and next.

    When we bind the data to the book, how can we know how many pages will take to show all the data? So this way, I would know what my last page number would be? And also, when I'm calculating the "Next" page number, I have to make sure I'm not exceeding the total Pages.

    In CoverFlow, if you exceed the total number of items, the CF engine will return you back to the first page. This would be nice to add to the book as well.

    According to the logic of your book framework, when jumping to a page, we always need to jump to the "Right side page" index. So, if a user wants to go to page 21, I need to check to see if the desired number is ODD or EVEN. If it's ODD, then add "1" to it, to ensure it's pointing to the right side page.
    I haven't tried yet, but what would happen if I tell the book to go t o page 21? :-)

    Thanks!


  2. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 10 Dec 2009 Link to this post

    Any comments...?
  3. DevCraft banner
  4. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 11 Dec 2009 Link to this post

    Hello Ben,

    Sorry for the late reply. Doesn't the RIA service return the whole collection of items? If it does return the whole set of items, then the total number of pages will correspond to the number of items in the collection. If the RIA service returns only part of the total number of items on the server, then no items control is able to know how many items there are actually stored on the server.

    If I have not understood your question correctly, could you please elaborate a little bit more on the scenario you are trying to achieve.


    Best wishes,
    Kiril Stanoev
    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.
  5. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 11 Dec 2009 Link to this post

    Hi Kiril;

    As I mentioned in PM, I'll bring it up here again. Only "IF" each page of the book holds "ONE" item then yes, it's straight forward. But what if the template would show three items per page, then there is a bit of calculation involved.

    You could leave it as is or you could add methods for navigation, as long as the book knows (from developer before instantiation) what's the total of items and how many items per page. This way your methods would use these two inputs for calculation.

    My humble suggestion is to have that in the framework (as long as it does not create side effects) so it's done once and every one uses it. I've seen other "complete" Flipbook toolkits in flash that these methods are just calls to be made by book user/developer.
    This is one of those requests that I'm 50/50 on it, unlike the feature to use left and right pages as one. :-)

    Hope this is clear!
    ..Ben
  6. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 16 Dec 2009 Link to this post

    Hello Ben,

    Thank you for your feedback. We will consider implementing such methods, but they will not be so highly prioritized as the "spread content on two pages" for example is, since the developer can easily implement them. Let me know if you have additional thoughts on the matter.


    Greetings,
    Kiril Stanoev
    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.
  7. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 16 Dec 2009 Link to this post

    Hi Kiril;

    Thanks for your considerations. As I've stated before, I'll make suggestions and the team decides when and how it's implemented. I have enough trust in you guys that it will be done right when it's done. But I'd highly prioritize two essential items when it comes to this control.One, as you pointed out, is spreading content between two pages and two would be a virtualization engine when dealing with lots of pages or more importantly when jumping to a page. I'd have these two on the top of the list.

    Thank you again!
    ..Ben
Back to Top
DevCraft banner