Page Orientation

4 posts, 1 answers
  1. Bastian Kraehmer
    Bastian Kraehmer avatar
    7 posts
    Member since:
    May 2010

    Posted 23 Nov 2011 Link to this post

    Hello,

    I have an RichTextBox with ad RichTextBoxRibbonUI.
    I implemented the "Orientation" - DropDownButton similar to the Silverlight Demo (http://demos.telerik.com/silverlight/#RichTextBox/TelerikEditor) like this:

    <Controls:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=ChangePageOrientationCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientation.png" Controls:ScreenTip.Description="Switch the pages between portrait and landscape layouts." Controls:ScreenTip.Title="Page Orientation" Size="Medium" Text="Orientation">
                                        <Controls:RadRibbonDropDownButton.DropDownContent>
                                            <Controls:RadGallery ItemHeight="54" ItemWidth="109" RichTextBoxUI:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangePageOrientationCommand}" ViewportHeight="216" ViewportWidth="110">
                                                <Controls:RadGalleryItem HorizontalContentAlignment="Left" Tag="Portrait">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationPortrait.png" Stretch="None" />
                                                        <TextBlock FontWeight="Bold" Text="Portrait" VerticalAlignment="Center" />
                                                    </StackPanel>
                                                </Controls:RadGalleryItem>
                                                <Controls:RadGalleryItem HorizontalContentAlignment="Left" Tag="Rotate90">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationLandscape.png" Stretch="None" />
                                                        <TextBlock FontWeight="Bold" Text="Landscape" VerticalAlignment="Center" />
                                                    </StackPanel>
                                                </Controls:RadGalleryItem>
                                                <Controls:RadGalleryItem HorizontalContentAlignment="Left" Tag="Rotate180">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationRotate180.png" Stretch="None" />
                                                        <TextBlock FontWeight="Bold" Text="Rotate 180" VerticalAlignment="Center" />
                                                    </StackPanel>
                                                </Controls:RadGalleryItem>
                                                <Controls:RadGalleryItem HorizontalContentAlignment="Left" Tag="Rotate270">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationRotate270.png" Stretch="None" />
                                                        <TextBlock FontWeight="Bold" Text="Rotate 270" VerticalAlignment="Center" />
                                                    </StackPanel>
                                                </Controls:RadGalleryItem>
                                            </Controls:RadGallery>
                                        </Controls:RadRibbonDropDownButton.DropDownContent>
                                    </Controls:RadRibbonDropDownButton>

    The problem is that the Button is always disabled.
    Is there any condition which prevents the button to be enabled?

    Regards,

    Bastian Kraehmer
  2. Answer
    Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 25 Nov 2011 Link to this post

    Hi Bastian Kraehmer,

    Having set the attached property RichTextBoxUI:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangePageOrientationCommand}", the button must be disabled when the CanExecute of the command returns false.

    The only condition that makes the CanExecute of ChangePageOrientationCommand return false is if the rich text box is used in read-only mode.

    Please find attached a demo project which uses the code from your snippet and works as expected. If you are not able to resolve the issue in your project, please attache a demo of yours in the support ticket you opened, so that we can assist you further.

    Best wishes,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. tarun
    tarun avatar
    1 posts
    Member since:
    Sep 2018

    Posted 19 Sep in reply to Bastian Kraehmer Link to this post

    I have did the same thing for page orientation,But its not working.So anything is there appart from this code.
  4. Peshito
    Admin
    Peshito avatar
    550 posts

    Posted 21 Sep Link to this post

    Hello tarun,

    It does not become clear what might be the cause of the issue. You can see a working SDK demo where the page orientation has been properly here - Telerik Editor.

    Regards,
    Peshito
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top