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;
6 Answers, 1 is accepted
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
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?
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
Thank you It was very useful
Hello Nimesh,
The binaries related to Telerik Document Processing can be found in the AdditionalLibraries folder of your local installation. Please, check the Included Assemblies help topic for a list with the binaries included in UI for ASP.NET AJAX and their location.
Regards,
Tanya
Progress Telerik