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

LightSwith and RadRichTextBox, loading DOCX

2 Answers 76 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
dejavu
Top achievements
Rank 2
dejavu asked on 28 May 2012, 11:12 PM
Hi.

Before using Telerik's RadRichTextBox on a working project, I used Microsoft Silevrlight RichTextBox. Problem was the need to create a mechanism to read a remote docx file with placeholders whos values were replaced by the end user with options from a LightSwitch screen. Process worked like a charm, but then we decide to change that control with Telerik's one. And this is the problem:

I need to load corresponding template upon user selection, in the lightswitch screen. Then, a WCF service reads that docx file, serialize it, and send it to a field in the LS screen. That field (a simple TextBox control) implements TextChanged event, and on that event, updates the RichTextBox parsing as it reads every line from DOCX format (OpenXML) to XAML.

I've tried several ways to implement this same funcionality using Telerik RadRichTextBox to no avail. The idea is:

On LS screen user selects from a dropdown template.
WCF service reads docx template, and populate with values user had chosen.
WCF service then returns a fully docx file, with those values on it, as a byte array to LS.
And finally, and here is my problem: how can I make RadRichTextBox understand that array (a docx file serialized) and shows me in the control XAML code, just like docx?

Regards,
dejavu

2 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 31 May 2012, 04:59 PM
Hi dejavu,
You can use RadRichTextBox's DocxFomatProvider to create RadDocument instance from byte array containing docx file, as described in more detail in this help article. For data binding, you can use DocxDataProvider as described here.

Don't hesitate to contact us if you have other questions.


Greetings,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
dejavu
Top achievements
Rank 2
answered on 31 May 2012, 06:08 PM
Thanks Boby for your reply.

We are just purchasing a license, and our intention is to implement your rad controls inside a LightSwitch OOB application. Before this, I wrote a control based on Microsoft Silverlight RichTextBox that implements fully parsing and conversion of OpenXML compliant documents. Tried then Telerik's controls and we decided to buy them

About the issue, we decided to stop using docx on behalf of xaml documents. Now, we can save them to our data base and convert at runtime. This because before using Teleriks controls we had a WCF service that implements document serialization, because of security concerns in Silevrlight and LightSwitch, and considering that our LS app is a SilverLight 5. And we have a lot of problems with System.Xml missing reference (ver. 5.0.5.0, conflicting with version in SL4), and the parsing mechanism based on XDocument.

So, please consider this post as resolved. Thanks!!
Tags
RichTextBox
Asked by
dejavu
Top achievements
Rank 2
Answers by
Boby
Telerik team
dejavu
Top achievements
Rank 2
Share this question
or