LightSwith and RadRichTextBox, loading DOCX

3 posts, 0 answers
  1. dejavu
    dejavu avatar
    18 posts
    Member since:
    Sep 2008

    Posted 28 May 2012 Link to this post


    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?

  2. Boby
    Boby avatar
    639 posts

    Posted 31 May 2012 Link to this post

    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.

    the Telerik team

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

  3. dejavu
    dejavu avatar
    18 posts
    Member since:
    Sep 2008

    Posted 31 May 2012 Link to this post

    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., conflicting with version in SL4), and the parsing mechanism based on XDocument.

    So, please consider this post as resolved. Thanks!!
Back to Top