Reading from database and saving back

6 posts, 0 answers
  1. Espen Moen Kvelland
    Espen Moen Kvelland avatar
    11 posts
    Member since:
    Jun 2009

    Posted 16 Jul 2010 Link to this post

    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
  2. Vesko
    Admin
    Vesko avatar
    45 posts

    Posted 19 Jul 2010 Link to this post

    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
  3. Espen Moen Kvelland
    Espen Moen Kvelland avatar
    11 posts
    Member since:
    Jun 2009

    Posted 24 Aug 2011 Link to this post

    Could you please update the question based on the current version off the RadControl
  4. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 29 Aug 2011 Link to this post

    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
  5. Steven
    Steven avatar
    4 posts
    Member since:
    Oct 2012

    Posted 12 Sep 2018 in reply to Vesko Link to this post

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


  6. Tanya
    Admin
    Tanya avatar
    822 posts

    Posted 17 Sep 2018 Link to this post

    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.
Back to Top