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

Text Formatting

2 Answers 143 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Dominik
Top achievements
Rank 1
Dominik asked on 28 Feb 2017, 02:42 PM

Hi, I am using a radrichtexteditor for displaying information about our application. I set the Text property of my radrichtexteditor. 

 

The text now is formatted with a size and font that I cannot work with. So i tried to set another Font and size. I found the following code online.

      loRadRichTextEditor:Document:Selection:SelectAll().
      loRadRichTextEditor:ChangeFontFamily(NEW Telerik.WinControls.RichTextEditor.UI.FontFamily("Courier New":U)).
      loRadRichTextEditor:ChangeFontSize(Telerik.WinForms.Documents.Model.Unit:PointToDip(8.75)).
      loRadRichTextEditor:RichTextBoxElement:ChangeParagraphLineSpacing(0.5).
      loRadRichTextEditor:RichTextBoxElement:ChangeParagraphSpacingAfter(12).
      loRadRichTextEditor:DocumentInheritsDefaultStyleSettings = TRUE.
      loRadRichTextEditor:Document:Selection:Clear().

 

This code is working fine but there are several radrichtexteditors on my view(tabs) and I have to set these properties for every control so bad performance. Is there a way to set the Font and the size more easily ?

Sincerely,

Dominik Zöbl

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 01 Mar 2017, 10:13 AM
Hi Dominik,

There is no easier way to change the font. Please note that if you want to save/restore the text formatting you should use one of our format providers instead of setting/getting the Text property: Import/Export | RadRichTextEditor.

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dominik
Top achievements
Rank 1
answered on 01 Mar 2017, 10:17 AM

Thanks for the fast answer Dimitar.

 

Sincerely,

Dominik

Tags
RichTextEditor
Asked by
Dominik
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Dominik
Top achievements
Rank 1
Share this question
or