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

Reading from database and saving back

5 Answers 256 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Espen Moen Kvelland
Top achievements
Rank 1
Espen Moen Kvelland asked on 16 Jul 2010, 11:41 AM
I have an ASP.NET application that makes the user open, read and save back word files. Today I'm using webdav to open the word files so the user can edit the files locally.

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

Thanks

5 Answers, 1 is accepted

Sort by
0
Vesko
Telerik team
answered on 19 Jul 2010, 02:17 PM
Hi Espen Moen Kvelland,

Thanks for your question!

Currently  RadRichTextBox Document Format Providers' API is restricted only to streams.
RadDocument Import(Stream input); 
void Export(RadDocument document, Stream output);
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,
Vesko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Espen Moen Kvelland
Top achievements
Rank 1
answered on 24 Aug 2011, 06:34 PM
Could you please update the question based on the current version off the RadControl
0
Iva Toteva
Telerik team
answered on 29 Aug 2011, 04:47 PM
Hello Espen Moen Kvelland,

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:
RadDocument Import(byte[] input);
byte[] Export(RadDocument document);
With the text-based formats (XAML, RTF, HTML and plain text), you can also use the following methods:
RadDocument Import(string input);
string Export(RadDocument document);

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.

Regards,
Iva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Steven
Top achievements
Rank 1
answered on 12 Sep 2018, 08:35 PM

"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?


0
Tanya
Telerik team
answered on 17 Sep 2018, 03:08 PM
Hello Steven,

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.

Regards,
Tanya
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RichTextBox
Asked by
Espen Moen Kvelland
Top achievements
Rank 1
Answers by
Vesko
Telerik team
Espen Moen Kvelland
Top achievements
Rank 1
Iva Toteva
Telerik team
Steven
Top achievements
Rank 1
Tanya
Telerik team
Share this question
or