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

RadRichTextBoxRibbonUI: Font family not set

1 Answer 84 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
caleb
Top achievements
Rank 1
caleb asked on 02 Dec 2016, 08:08 AM

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

 

1 Answer, 1 is accepted

Sort by
0
caleb
Top achievements
Rank 1
answered on 09 Dec 2016, 07:28 AM

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

Tags
RichTextBox
Asked by
caleb
Top achievements
Rank 1
Answers by
caleb
Top achievements
Rank 1
Share this question
or