Default Font Size in RichTextBox

4 posts, 0 answers
  1. Kate
    Kate avatar
    17 posts
    Member since:
    Jul 2010

    Posted 14 Dec 2010 Link to this post

    Hello! I use RichTextBox with HtmlDataProvider:

    <documentsHtml:HtmlDataProvider x:Key="htmlDataProvider"
                               RichTextBox="{Binding ElementName=richTextBox}"
                               Html="{Binding Path=SelectedMessage.NewText, Mode=TwoWay}"
                               SetupDocument="HtmlDataProvider_SetupDocument"/>

    When NewText is null or empty RichTextBox shows blank RadDocument and the font size ComboBox shows 12:

    <telerik:RadRibbonComboBox CanAutocompleteSelectItems="False" CanKeyboardNavigationSelectItems="False" CommandParameter="{Binding SelectedItem.Tag, RelativeSource={RelativeSource Self}}" Height="21" IsEditable="False" IsReadOnly="True" OpenDropDownOnFocus="True" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding ChangeFontSizeCommand}" Width="45" DataContext="{Binding ElementName=richTextBox}">

    How can I change the default font size to another value?
  2. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 16 Dec 2010 Link to this post

    Hello Kate,

    Currently HtmlDataProvider expects to get the font properties from the Source of the binding, specified in the Html property. The default FontFamily in HTML is Times New Roman and the FontSize is 12, hence your ComboBox's 12.
    We have considered reviewing this behavior and have decided to include an option for applying the default font properties, defined on RadRichTextBox, onto paragraphs and spans of the document that do not set them explicitly. This change, though, will most probably not appear in the service pack, but in a next release.
    If you have any other questions, do not hesitate to contact us again.

    Regards,
    Iva
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. Boby
    Admin
    Boby avatar
    763 posts

    Posted 20 Dec 2010 Link to this post

    Hello Kate,

    Another workaround you can try is described in the following thread (especially the discussion with
    Michael Montgomery and the sample solution we send to him).

    Greetings,
    Boby
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  4. Kate
    Kate avatar
    17 posts
    Member since:
    Jul 2010

    Posted 23 Dec 2010 Link to this post

    Thanks a lot! We've solved the problem.
Back to Top