Is there any way of doing something likethis:
1. The user browses his files, Docx or just database records, preferable docx files
2. The user clicks one of the items, a new web window opens with a silverlight page that holds the richtexteditor and the content of the file.
3. the user saves the contect back
5 Answers, 1 is accepted
Thanks for your question!
Currently RadRichTextBox Document Format Providers' API is restricted only to streams.
This means that if you want to open a document, which is located in the DB, file system, etc. you should provide a stream to this resource.
For more information you can also check the this forum post giving some more details about saving/loading document (including short RIA Services Demo).
If your files are on the server side in DB/File System/etc. you can provide access to them trough a web service (RIA/WCF). If the files are client-side located the opening of the files should be user intended - trough OpenFile dialog.
So - making transition from the web page to the Silverlight one could be done in for example like this: the Silverlight page should be given enough information such that it to be able to make the request to the server asking for the proper resource. For example it could be given an ID/GUID to matching the required document trough post/get data.
Saving change could be done symmetrically.
If you have any further questions please let us know.
In the upcoming version of the RadRichTextBox we will provide an extended API for importing/exporting from/to byte array for binary formats such as DOCX as well as string for the text based formats (XAML, HTML, TXT).
All the best,
the Telerik team
What Vesko has said is also true about the current version of the controls - Q2 2011 (2011.2.712). The only thing that can be added is that overloaded methods for import and export of the document have been added.
You can load files using a byte array representation of their content. The methods you can use in addition to those in Vesko's code-snippet are:
With the text-based formats (XAML, RTF, HTML and plain text), you can also use the following methods:
More information on import and export and supported file formats can be found here and the data providers which can be used to bind the content of the document are described in this article.
the Telerik team
"In the upcoming version of the RadRichTextBox we will provide an extended API for importing/exporting from/to byte array for binary formats such as DOCX as well as string for the text based formats (XAML, HTML, TXT)."
Has the newest version enabled above yet?
I just spent a few hours in code using for the first time in WinForms the RichTextEditor and discover it will not save in HTML format?
Yes, the latest version of the control supports all the discussed formats as well as export to PDF. You can find information about the import and export functionalities in our documentation. More specifically, the information about exporting to HTML is located in the Using HtmlFormatProvider topic.
Hope this is helpful.