RadButton BookCommands and RadBook issue

3 posts, 1 answers
  1. Darren
    Darren avatar
    6 posts
    Member since:
    Dec 2010

    Posted 11 Feb 2011 Link to this post

    I've got a couple pages that utilize the RadBook control and then RadButtons using the BookCommands to turn pages. However, the buttons don't enable when the document is loaded. If I change a page by clicking in the top left corner (or dragging the corner), then the buttons enable.

    On one page, the RadBook is integrated with the RadRichTextPageView like the sample. The word document is retrieved as a byte array from a web service and then loaded into the RadBook control. However, the RadButtons for Previous and Next page don't enable at this time, regardless of how many pages are loaded. Is there something that has to be done to enable this?

    Similarly, I have another page which loads a series of images from a webservice and adds them manually to the RadBook.Items collection (byte array --> Bitmap Image --> Image --> RadBook.Items.Add). Initially, three pages are loaded, with pairs of pages being added when the PageChanged event is fired. The same behavior for the RadButtons (using the BookCommands) is experienced, where even though 3 pages are there, the next button is not enabled. If I manually change the page, then suddenly the Previous button is enabled. Is there some command that I have to use to enable these buttons right away?

    Thanks.
  2. Answer
    Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 16 Feb 2011 Link to this post

    Hi Darren,

    The commands will disable the buttons if the command cannot be executed. For example, if you are on the first page, the previous page command button will be disabled, because the PreviousPage command cannot be executed. The command will enable the button once you have flipped at least one page.

    If that is not the case, you can try calling the CommandManager.InvalidateRequierySuggested method, which will force all of the commands to reevaluate themselves.

    Best wishes,
    Alex Fidanov
    the Telerik team
  3. DevCraft banner
  4. Darren
    Darren avatar
    6 posts
    Member since:
    Dec 2010

    Posted 16 Feb 2011 Link to this post

    Thanks, that was exactly what I was looking for.
Back to Top