Hide LayoutModeSelectorName on the RadRichTextBoxStatusBar

6 posts, 0 answers
  1. Alan
    Alan avatar
    6 posts
    Member since:
    Jan 2013

    Posted 29 Apr 2014 Link to this post

    I have searched high an low and cannot figure out how to Hide the LayoutModeSelectorName  on the  RadRichTextBoxStatusBar.  I do not want my users switching to a different word layout in my application, how can I do this?

    Thanks

  2. Todor
    Admin
    Todor avatar
    168 posts

    Posted 30 Apr 2014 Link to this post

    Hello Alan,

    You can edit the LayoutModeSelector's template to achieve a different look of the control than the default one. In order you want to remove the LayoutModeSelector control from the RadRichTextBoxStatusBar, you should remove that control from the RadRichTextBoxStatusBar's control template.

    For your convenience, I've attached a project which illustrates how to do both of the above described control template changes. The changes are made in App.xaml file and a 'NOTE:' comment precedes every change.

    Please note, that NoXAML assemblies are used in the project. I'm recommending this approach when you are applying a theme on the controls. You can read more about implicit styles here.

    In order you are using XAML assemblies in your application, you can use the same edited styles which are used in the sent project as well.

    Regards,
    Todor
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. Alan
    Alan avatar
    6 posts
    Member since:
    Jan 2013

    Posted 30 Apr 2014 Link to this post

    Thank you very much Todor, that did exactly what I wanted it to do and I was successful in putting the change in my new product :)
  4. Marc
    Marc avatar
    4 posts
    Member since:
    Jun 2016

    Posted 12 Sep in reply to Todor Link to this post

    Hi,

    I tried using this solution with Visual Studio 2015 and the 2017 Q2 version of the WPF controls and I am getting this error: 'The resource "RadRichTextBoxStatusBarStyle" could not be resolved.' on this line:

     

            <Style TargetType="telerikControlsRTBUI:RadRichTextBoxStatusBar" BasedOn="{StaticResource RadRichTextBoxStatusBarStyle}">

     

    I have these two lines in my .xaml file:

     

            xmlns:telerikControlsRTBUI="clr-namespace:Telerik.Windows.Controls.RichTextBoxUI;assembly=Telerik.Windows.Controls.RichTextBoxUI"
            xmlns:telerikControlsRTBUIStatusBar="clr-namespace:Telerik.Windows.Controls.RichTextBoxUI.StatusBar;assembly=Telerik.Windows.Controls.RichTextBoxUI"

     

    I am using the version of the WPF controls with embedded .xaml so I am not specifying the merged dictionaries.  Can this code be used with the embedded .xaml controls?  Or can it only be used with the NoXAML assemblies?

    Marc

  5. Tanya
    Admin
    Tanya avatar
    577 posts

    Posted 15 Sep Link to this post

    Hi Marc,

    Yes, you can use the customization when using the XAML binaries as well. You will need to remove the static resources referring the styles or copy the styles from the corresponding NoXaml style.

    Another option I can suggest you is to define your custom style and apply it to the status bar of RadRichTextBox:
    <Style x:Key="MyStatusBarStyle" TargetType="telerik:RadRichTextBoxStatusBar">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadRichTextBoxStatusBar">
                    <Border BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}">
                        <Grid x:Name="LayoutRoot" VerticalAlignment="Center" HorizontalAlignment="Right">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <telerikControlsRTBUIStatusBar:ZoomController x:Name="zoomController" Grid.Column="1" Margin="0 0 6 0"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    Hope this is helpful.

    Regards,
    Tanya
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  6. Marc
    Marc avatar
    4 posts
    Member since:
    Jun 2016

    Posted 15 Sep in reply to Tanya Link to this post

    Thanks Tanya,

    That confirmed what I suspected.  Removing the static resources did the trick.

    Marc

Back to Top