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

Format RichTextBox

1 Answer 106 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 20 Jan 2012, 12:39 AM
Hi,

I am having a very hard time finding the right documentation/example on how to override the default formatting/css that is occurring in a RichTextBox that is loaded with HTML.

I have already found and tweaked the appropriate settings to make the HTML a fragment, but for the life of me I can't seem to figure out how to declare the css that I would liked applied to the HTML within the RichTextBox.

A perfect example is I need the following css to be applied to the HTML content.

<style type="text/css">
ol {
    list-style-type: upper-roman;
}

ol ol {

    list-style-type: upper-alpha;
}
outline.css (line 5) 

 ol ol ol {
    list-style-type: decimal;
}
</style>

Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 25 Jan 2012, 10:35 AM
Hello Jim,

Setting default style settings on the document is described here. You should have in mind that when loading a document from a rich text format such as HTML, the font settings specified in the document will be used. If no font settings are specified, the default values of the format will be used. For HTML that would be Times New Roman, 12 pt (16 px).

When it comes to customizing the list types, you can read more on the available customization options in this article.

Overall, you should have in mind that RadRichTextBox is not an HTML editor and it has an internal format quite different from HTML. When you import a document, it is converted to the document model of the editor and on export, the reverse operation occurs. You can adjust the import and export using HtmlImportSettings and HtmlExportSettings, as outlined in this article.

I hope this answers your question.

Kind regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Jim
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or