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

"Total # of Pages" in the book question

5 Answers 57 Views
Book
This is a migrated thread and some comments may be shown as answers.
Ben Hayat
Top achievements
Rank 2
Ben Hayat asked on 08 Dec 2009, 04:45 PM
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!


5 Answers, 1 is accepted

Sort by
0
Ben Hayat
Top achievements
Rank 2
answered on 11 Dec 2009, 02:11 AM
Any comments...?
0
Kiril Stanoev
Telerik team
answered on 11 Dec 2009, 02:36 PM
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.
0
Ben Hayat
Top achievements
Rank 2
answered on 11 Dec 2009, 05:14 PM
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
0
Accepted
Kiril Stanoev
Telerik team
answered on 16 Dec 2009, 03:33 PM
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.
0
Ben Hayat
Top achievements
Rank 2
answered on 16 Dec 2009, 04:28 PM
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
Tags
Book
Asked by
Ben Hayat
Top achievements
Rank 2
Answers by
Ben Hayat
Top achievements
Rank 2
Kiril Stanoev
Telerik team
Share this question
or