Text Formatting

3 posts, 1 answers
  1. Dominik
    Dominik avatar
    14 posts
    Member since:
    Jan 2017

    Posted 28 Feb 2017 Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    2807 posts

    Posted 01 Mar 2017 Link to this post

    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.
  3. Dominik
    Dominik avatar
    14 posts
    Member since:
    Jan 2017

    Posted 01 Mar 2017 Link to this post

    Thanks for the fast answer Dimitar.

     

    Sincerely,

    Dominik

Back to Top