Keeping format of MSWord

16 posts, 1 answers
  1. Triet Nguyen Cong
    Triet Nguyen Cong avatar
    78 posts
    Member since:
    Mar 2010

    Posted 29 Jun 2010 Link to this post

    Hi Telerik team,

    Is there any control can read content and format of a word file?

    Thanks,
    Triet
  2. Mike
    Admin
    Mike avatar
    640 posts

    Posted 29 Jun 2010 Link to this post

    Hello Triet,

    Yes indeed, we just released a beta of RadRichTextBox that is able to edit and import/export DOCX and HTML documents:
    http://www.telerik.com/products/silverlight/richtextbox.aspx
    Here is a Demo:
    http://demos.telerik.com/silverlight/beta/#RichTextBox/MSWord
    Demo code:
    http://www.telerik.com/community/forums/silverlight/richtextbox/telerik-richtextbox-demo.aspx

    More info:
    http://blogs.telerik.com/silverlightteam/posts/10-04-16/a_new_native_silverlight_4_rich_text_editor_coming_up.aspx

    http://blogs.telerik.com/silverlightteam/posts/10-06-17/what_s_new_in_the_beta_of_radrichtextbox_for_silverlight.aspx

    CTP Documentation:
    http://www.telerik.com/help/silverlight/radrichtextbox-overview.html

    Regards,
    Mike
    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. Triet Nguyen Cong
    Triet Nguyen Cong avatar
    78 posts
    Member since:
    Mar 2010

    Posted 30 Jun 2010 Link to this post

    Thanks Mike,

    That is amazing, I have one question: How do I save data from RadRich Textbox to the database?

    Regards,
  4. Mike
    Admin
    Mike avatar
    640 posts

    Posted 02 Jul 2010 Link to this post

    Hi Triet Nguyen Cong,

    You can export the content of RadRichTxtBox in Xaml string and the store it wherever you may need:

    private void SaveDocument_Click(object sender, RoutedEventArgs e)
    {
        IDocumentFormatProvider exporter = new XamlFormatProvider();
        using (MemoryStream stream = new MemoryStream())
        {
            exporter.Export(this.radRTB.Document, stream);
            stream.Seek(0, SeekOrigin.Begin);
            StreamReader reader = new StreamReader(stream);
            documentContent = reader.ReadToEnd();
        }
    }       
     
    private void LoadDocument_Click(object sender, RoutedEventArgs e)
    {
        XamlFormatProvider provider = new XamlFormatProvider();
        using (MemoryStream stream = new MemoryStream())
        {
            StreamWriter writer = new StreamWriter(stream);
            writer.Write(documentContent);
            writer.Flush();
            stream.Seek(0, SeekOrigin.Begin);
            radRTB.Document = provider.Import(stream);
        }
    }

    In this case documentContent string variable may be stored in a DB.

    All the best,
    Mike
    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. Triet Nguyen Cong
    Triet Nguyen Cong avatar
    78 posts
    Member since:
    Mar 2010

    Posted 08 Jul 2010 Link to this post

    Hi Mike,

    Could you provide me more detail about this sample (UI, code behind)?
    Thanks
  6. Alex
    Admin
    Alex avatar
    130 posts

    Posted 14 Jul 2010 Link to this post

    Hi Triet Nguyen Cong,

    Please find attached a short example project which uses WCF RIA Services to store and load documents form database. 

    Note that this example uses the version of RadRichTextBox from the Q2 official release.

    Regards,
    Alex
    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
  7. Triet Nguyen Cong
    Triet Nguyen Cong avatar
    78 posts
    Member since:
    Mar 2010

    Posted 19 Jul 2010 Link to this post

    I read your example.
    But i use mvvm pattern, so i dont want to use code behind to bind data to RichTextBox.
    How can i bind data from viewmodel?
    Thanks in advand.
  8. Alex
    Admin
    Alex avatar
    130 posts

    Posted 21 Jul 2010 Link to this post

    Hello Triet Nguyen Cong,

    We will try to make a more complete example with RIA Services and Database for the Service Pack after a few weeks.
    Meanwhile you can check this forum thread to see how to implement a wrapper or RadRichTextBox add a Dependency Property using the available format providers and then use binding.
    I hope this is helpful!

    All the best,
    Alex
    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
  9. Triet Nguyen Cong
    Triet Nguyen Cong avatar
    78 posts
    Member since:
    Mar 2010

    Posted 23 Jul 2010 Link to this post

    Thanks Alex!

    I have another question. I have a RadDocument. i can bind RadDocument to Richtextbox. but now i want change a word to a link.

    I know the element hierarchy. RadDocument=>Section=>Paragraph=>Span & Hyperlink &InlineImage

    now i have a span contain "ABCD" i want to change it to a Hyperlink "ABCD". when i add a new hyperlink, it appears at the end of paraghaph not at the position i want to, i can't remove the old span and replace a hyperlink.

    how could i do that?
  10. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 28 Jul 2010 Link to this post

    Hello Triet Nguyen Cong,

    I have created a demo project for you, which replaces the current document selection or the word in which the caret currently is positioned with a hyperlink with the same text. If you need any further assistance, don't hesitate to contact us.

    Sincerely yours,
    Ivailo
    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
  11. Triet Nguyen Cong
    Triet Nguyen Cong avatar
    78 posts
    Member since:
    Mar 2010

    Posted 01 Aug 2010 Link to this post

    Thank you! This has helped my problem!

    I have another question. I have a hyperlink on my Rich textbox. Hyperlink’s link will be showed when I mouse over that hyperlink, how could I modified that tooltip? Size, font, width ,remove text 'ctrl+click to folow...'…

  12. Answer
    Vesko
    Admin
    Vesko avatar
    45 posts

    Posted 02 Aug 2010 Link to this post

    Hello Triet Nguyen Cong,

    Thanks for your question!
    Currently the hyperlink customization is limited and the things you want to achieve are not doable now. I am adding this feature to out to-do list for the next version and  we will ensure that such customization is possible. We will appreciate any thoughts about how do you expect this feature to behave.

    Regards,
    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
  13. lori guymon
    lori guymon avatar
    23 posts
    Member since:
    May 2004

    Posted 16 Aug 2010 Link to this post

    Hi Alex,
    In your July 21st reply, you mentioned you would may be putting together another example after the SP1 release using the RichTextBox along with RIA Services and MVVM.  I'm just curious if that is available.
    Thanks!
  14. Mike
    Admin
    Mike avatar
    640 posts

    Posted 17 Aug 2010 Link to this post

    Hello Lori Guymon,

    Here is the updated sample that uses the new DataProvider components we introduced in Q2 SP1 which allow data binding. Note that the sample demonstrates how to use data binding with RadRichTextBox to load/store documents in a database, as we promised. This sample does not fully utilize the MVVM approach.

    Let us know if this helped.

    Greetings,
    Mike
    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
  15. Inbal
    Inbal avatar
    1 posts
    Member since:
    Apr 2011

    Posted 14 Apr 2011 Link to this post

    Hi,

    I am using RadRichTextBox and I am looking for a way to set different Tooltips for Hyperlinks on a document.
    I found a way to set the same tooltip for all Hyperlinks by using 'HyperlinkToolTipFormatString' property,
    but what I need is set a different tooltip for each hyperlink.
    Is this feature supported? if so how can I do this?

    Thanks
  16. Mike
    Admin
    Mike avatar
    640 posts

    Posted 20 Apr 2011 Link to this post

    Hi lori guymon,

    Unfortunately this feature is still not available in RadRichTextBox. We will add it in our to-do list however it is hard for us to give you any specific time-frame for its availability. Hopefully it will be available for Q2. Is the meanwhile let us know if you have other suggestions or questions.

    Kind regards,
    Mike
    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
Back to Top