Is it possible to block user from turning page?

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

    Posted 03 Dec 2009 Link to this post

    Is it possible that we would block the user to turn the page either by clicking, or grabbing corner or keyboard? If not, would be possible to have a property "TurnPage" to False/True (default to True), and if it's set to false, ONLY the page would turn via code, i.e the code would decide to go to next page or page 10, based on certain conditions?

    Thanks as always!
    ..Ben

    [Update]
    I thought I provide a small case for this request. Suppose you develop a Quiz app that the user provides an answer to a question on page 1. Depending on the answer, the program may transfer to page 3 or 4 or 6. This way, the user is not allowed to go other pages on their own.
    Thanks!
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 04 Dec 2009 Link to this post

    Hi ..Ben,

    Currently you can handle the PreviewFlipStarted event and to cancel it by setting e.Handled=true; in the event handler.

    Best wishes,
    Valentin.Stoychev
    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.
  3. DevCraft banner
  4. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 04 Dec 2009 Link to this post

    So, we need to have a flag to indicate if the turning is being done via code to allow it, and if the flag is null, then that means the user is is flipping and block it via event. I think this can be used, but a property would make it simpler to use.

    Thanks!
    ..Ben
  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 07 Dec 2009 Link to this post

    Hello Ben,

    Introducing a new property(ex. AllowPageTurn) can easily be done, but then some questions might arise. Which is with greater priority - the PreviewFlipStarted event or the AllowPageTurn property? What happens if you handle the PreviewFlipStarted event and set AllowPageTurn to true? What about the other way around? This deserves deeper discussion, so I'd be glad if you can share you opinion on the subject.


    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.
  6. Ben Hayat
    Ben Hayat avatar
    892 posts
    Member since:
    May 2008

    Posted 07 Dec 2009 Link to this post

    Hi Kiril;

    Thank you for your thoughtful response. And you're absolutely right that it deserves a deeper discussion, because we have more than one elements that affect that decision making.

    Although Valio brought it up first, but now that you brought up the combo effect, I see the point.
    Here is my take at it:

    a) When the AllowPageTurn is set to true, It would be exactly as it is now, which means if PreviewFlipStarted is handled, then it stop the page, which is the same as AllowTurnPage to False.
    b) However, if AllowTurnPage is set to False, then it overwrites the PreviewFlipStarted event. Basically, the AllowPageTurn has the maximum power.

    But This power only disables the page turn via mouse and keyboard by the user and not code turning the page.
    I ultimately leave the final decision to you guys and I'm sure the decision will be the correct one like I see the rest of the controls. If you see that the addition of the property does NOT create side effects, then it would be nice to have. If not, I'll go via event handling.

    But when we turn page via code, please make turn like it was done via click or keyboard.
    Thanks!
  7. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 08 Dec 2009 Link to this post

    Hi Ben,

     Thank you for elaborating on your opinion. We'll take it into consideration the next time we work on RadBook's API. Also, thanks for pointing that some events are not fired when turning the pages programatically. I'll make sure to fix this either for this week or next week's internal build. I have also updated your Telerik points.


    Regards,
    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.
  8. Simon
    Simon avatar
    7 posts
    Member since:
    Jul 2010

    Posted 19 Jul 2010 Link to this post

    I was wanting to prevent the user turning pages, but can't see how to do this with the latest version.

    I believe that events such as PreviewPageFlipStarted are now called when flipping the pages via code (either by RadBook.NextPage() or by manipulating RadBook.RightPageIndex).  This means that setting e.Handled in the PreviewPageFlipStarted event will not allow page turns at all (manually or via code).

    The best solution I can come up with at the present time is by setting the following properties of the book, however, if the user clicks in the very corners of a page (in the small 1x1 foldsize) they could still do it.

        PageFlipMode

     

    ="None" ShowPageFold="Never" FoldSize="1,1"

     


    Are there any other solutions to this at present?
  9. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 20 Jul 2010 Link to this post

    Hello Simon,

    If you want to turn the pages only from code you can set a variable that the flipping is done from code and not the set the e.Handled to True in the PreviewPageFlipStarted event.

    Kind regards,
    Valentin.Stoychev
    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
  10. Simon
    Simon avatar
    7 posts
    Member since:
    Jul 2010

    Posted 20 Jul 2010 Link to this post

    Thanks Valentin,

    That will solve my issue.  I'll set a flag when my next/previous button is clicked to indicate it's a code related flip and then only set e.Handled if this flag is false.

    I should have thought of that.  Thanks for the quick response.

    Simon.
Back to Top
DevCraft banner