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

Default Font Properties

1 Answer 86 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ola Karlsson
Top achievements
Rank 1
Ola Karlsson asked on 16 Dec 2010, 07:55 AM
Hi,

I'm trying to use the RichTextBox but I'm having some issues.

I'm using the RichTextBox to allow users to input some rich text, this text is then displayed on a linked Asp.Net website.
I'm doing this by using the HtmlDataProvider to convert the input to HTML, then I save it in the database.

How can I set the default font and text color, so that it get's saved when I save the text using the HtmlDataProvider?

Thanks,
Ola

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 16 Dec 2010, 02:28 PM
Hello Ola Karlsson,

Currently HtmlDataProvider expects to get the font properties from the Source of the binding, specified in the Html property, so that the text will look as close as possible to the way it would appear in a browser. Thus, the assumed FontFamily and FontSize are the default ones in HTML - Times New Roman and 12.

We 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.

However, if this approach suits your scenario, you can walk the document tree and change each Span's font and foreground color accordingly.

If you have any other questions, do not hesitate to contact us again.

All the best,
Iva
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
RichTextBox
Asked by
Ola Karlsson
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or