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

Default Font Size in RichTextBox

3 Answers 148 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Kate
Top achievements
Rank 1
Kate asked on 14 Dec 2010, 09:51 AM
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?

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 16 Dec 2010, 02:01 PM
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
0
Boby
Telerik team
answered on 20 Dec 2010, 08:57 AM
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
0
Kate
Top achievements
Rank 1
answered on 23 Dec 2010, 05:55 PM
Thanks a lot! We've solved the problem.
Tags
RichTextBox
Asked by
Kate
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Boby
Telerik team
Kate
Top achievements
Rank 1
Share this question
or