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

RadButton BookCommands and RadBook issue

2 Answers 63 Views
Book
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 11 Feb 2011, 09:37 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Alex Fidanov
Telerik team
answered on 16 Feb 2011, 05:29 PM
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
0
Darren
Top achievements
Rank 1
answered on 16 Feb 2011, 05:45 PM
Thanks, that was exactly what I was looking for.
Tags
Book
Asked by
Darren
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Darren
Top achievements
Rank 1
Share this question
or