RadRichTextBoxRibbonUI: Font family not set

2 posts, 0 answers
  1. caleb
    caleb avatar
    32 posts
    Member since:
    Sep 2011

    Posted 02 Dec 2016 Link to this post

    Hello there,

     

    I'm using the Silverlight UI v. 2016.2.613.1050. I'm having a strange issue with the font family dropdown in the RadRichTextBoxRibbonUI.  It's not set when the form loads. 

    Here's the xaml for the Ribbon:

    <telerik:RadRichTextBoxRibbonUI
            Grid.Row="0"
            CollapseThresholdSize="35,35"
            DataContext="{Binding Commands, ElementName=radRichTextBox}"
            ApplicationName="Document editor"
            IsMinimized="True"
            MinimizeButtonVisibility="Visible"
            IsBackstageOpen="False"
            Name="radRichTextBoxRibbonUI"
            Background="LightGray"
            BackstageClippingElement="{Binding ElementName=LayoutRoot}"
             
            ApplicationButtonImageSource="/RichTextBox;component/Images/RichTextBox/MSOffice/AppIcon-telerik.png"
                 
        >

    Here's the xaml for the combo box:

    <telerik:RadRibbonComboBox
        CanAutocompleteSelectItems="False"
        CanKeyboardNavigationSelectItems="False"
        CommandParameter="{Binding SelectedValue, RelativeSource={RelativeSource Self}}"
        telerik:ScreenTip.Description="Change the font family."
        IsReadOnly="False"
        ItemsSource="{Binding RegisteredFonts, Source={StaticResource FontFamiliesProvider}}"
        MaxDropDownHeight="400"
        OpenDropDownOnFocus="True"
        telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding ChangeFontFamilyCommand}"
        telerik:ScreenTip.Title="Font"
        Width="132"
    />

     

    Here's the xaml for the rad rich text box:

    <telerik:DocumentRuler
                Grid.Row="1"
            >
                <telerik:RadRichTextBox
                    VerticalScrollBarVisibility="Auto"
                    IsImageMiniToolBarEnabled="False"
                    IsSelectionMiniToolBarEnabled="False"
                    IsTrackChangesEnabled="False"
                    x:Name="radRichTextBox"
                    IsSpellCheckingEnabled="{Binding Source={StaticResource userPreferencesViewModelNew}, Path=IsSpellCheckEnabled}"
                    LayoutMode="Paged"
                    BorderThickness="0"
                    Loaded="RadRichTextBox_OnLoaded"           
                    AcceptsReturn="True"
                    AcceptsTab="True"
                    DocumentInheritsDefaultStyleSettings="True"
                    FontFamily="{Binding Source={StaticResource userPreferencesViewModelNew}, Path=TextFontFamily}"
                    FontSize="{Binding Source={StaticResource userPreferencesViewModelNew}, Path=TextFontSize}"
                >
                <telerik:RadDocument SectionDefaultPageSize="400,800" />
            </telerik:RadRichTextBox>
        </telerik:DocumentRuler>

     

    The font family is set in the Rad Rich Text Box correctly.  It's not reflecting in the dropdown.

    Using the VisualStudio2013 theme with unmodified xaml styles.

     

    Any thoughts on what is incorrect here?

     

    Thanks

     

    Caleb

     

  2. caleb
    caleb avatar
    32 posts
    Member since:
    Sep 2011

    Posted 09 Dec 2016 in reply to caleb Link to this post

    Hello there,

    I was using a custom font family for the Rich Text Box.  I noticed that the code sample provided by Telerik also did not set the font family as well.  After that realization I just created a converter to set the SelectedIndex on the Font Family dropdown.  Problem solved.

    Caleb

Back to Top