Hi,
I used the MsRichTextBoxXamlFormatProvider to edit some FlowDocument I have in a database.
While reading seems to be ok, exporting a FlowDocument has a bug : FontWeight information is lost !
After digging in the code using a disassembler, I found the origin of the bug :
You should add :
Inline.FontWeight = span.FontWeight ;
In MsRichTextBoxXamlExporter.CopySpanStyleToInline(Span span, Inline inline).
Regards,
5 Answers, 1 is accepted
Thank you for reporting this bug and evening taking the effort to find the origin of the problem.
We will make sure to include the fix in the service pack in mid September.
The Telerik points in your account have been updated as a token of our appreciation.
Iva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Is this bug fixed?
After upgrading to version 2011.2.920.1040 I still loose the FontWeight.
If the bug is fixed (which should have been since the September version as stated before), could you provide me sample of how to use it?
Here is what I am doing:
XamlFormatProvider xamlFP = new XamlFormatProvider();
MsRichTextBoxXamlFormatProvider msXamlFP = new MsRichTextBoxXamlFormatProvider();
var doc = xamlFP.Import(this.TelerikXamlNote);
return msXamlFP.Export(doc);
TelerikXamlNote in this case is a string with the content of a RadRichTextBox. It has italic, bold, underline and highlight. In this case, the highlight is lost but that was no surprise since MS RichTextBox does not support background brushes. However, the font weight is lost, and that was not expected.
Thanks for any help.
Unfortunately, the bug fix was not included in the September version of the controls. We will however make sure to include it in the upcoming Q3 release.
Please accept our apologies for the inconvenience.
Iva Toteva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Can you please confirm if the above issue is fixed. If so, can you please provide a sample code.
Thanks,
The issue discussed in this topic has been fixed shortly after the last post back in 2011.
When it comes to sample code, I am not sure what exactly you need. This thread discusses export of RadDocument to string which is pretty straigthforward - you just need to create the respective format provider and call its Export() method. In fact, the provider allows you to directly export a RadDocument to FlowDocument or RichTextBox.
MsRichTextBoxXamlFormatProvider provider =
new
MsRichTextBoxXamlFormatProvider();
string
content = provider.Export(
this
.radRichTextBox.Document);
FlowDocument flowDoc = provider.ExportToFlowDocument(
this
.radRichTextBox.Document);
RichTextBox box = provider.ExportToRichTextBox(
this
.radRichTextBox.Document);
I hope this helps.
Regards,
Petya
Telerik