RadFlowDocumentEditor how to change weight

5 posts, 1 answers
  1. Miriam
    Miriam avatar
    8 posts
    Member since:
    Mar 2017

    Posted 23 Mar Link to this post

    Hi, I wonder if you can help with my issue

    How do you change the weight,  when writing a Microsoft Word document using RadFlowDocumentEditor?

    I have a problem when I try to put a bold text, because I get the next error: The name 'FontWeights' does not exist in the current context

    The code I'm using is:

     RadFlowDocument document = new RadFlowDocument();
     RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);

    editor.InsertLine("PASO 3: Detección de riesgos para el nacimiento").FontWeight =  FontWeights.Bold;  

     

  2. Tanya
    Admin
    Tanya avatar
    583 posts

    Posted 28 Mar Link to this post

    Hi Miriam,

    The FontWeights enumeration is declared in the System.Windows namespace and to use it, you should add a reference to the PresentationCore.dll assembly in your project.

    Hope this helps.

    Regards,
    Tanya
    Telerik by Progress

  3. Miriam
    Miriam avatar
    8 posts
    Member since:
    Mar 2017

    Posted 31 Mar in reply to Tanya Link to this post

    Thank you It was very useful.

    I have another question

    Is it possible to put bold and underline text at the same time? As shown in the picture

    And how could I do it?

     

     

     

     

    It is possible to put text in bold and underlined at the same time
    It is possible to put text in bold and underlined at the same time
    Is it possible to put bold and underlined text at the same time?
    Is it possible to put bold and underlined text at the same time?
    Is it possible to put bold and underlined text at the same time?
  4. Answer
    Tanya
    Admin
    Tanya avatar
    583 posts

    Posted 04 Apr Link to this post

    Hi Miriam,

    Yes, it si possible using the properties of the Run element. Here is an example:
    Run run = editor.InsertLine("PASO 3: Detección de riesgos para el nacimiento");
    run.FontWeight = FontWeights.Bold;
    run.Underline.Pattern = UnderlinePattern.Single;
    run.Underline.Color = new ThemableColor(Colors.Black);

    Hope this is helpful.

    Regards,
    Tanya
    Telerik by Progress

  5. Miriam
    Miriam avatar
    8 posts
    Member since:
    Mar 2017

    Posted 04 Apr in reply to Tanya Link to this post

    Thank you It was very useful

     

Back to Top