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

Keeping format of MSWord

15 Answers 530 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Triet Nguyen Cong
Top achievements
Rank 2
Triet Nguyen Cong asked on 29 Jun 2010, 11:53 AM
Hi Telerik team,

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

Thanks,
Triet

15 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 29 Jun 2010, 01:04 PM
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
0
Triet Nguyen Cong
Top achievements
Rank 2
answered on 30 Jun 2010, 09:52 AM
Thanks Mike,

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

Regards,
0
Mike
Telerik team
answered on 02 Jul 2010, 08:08 AM
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
0
Triet Nguyen Cong
Top achievements
Rank 2
answered on 08 Jul 2010, 08:13 AM
Hi Mike,

Could you provide me more detail about this sample (UI, code behind)?
Thanks
0
Alex
Telerik team
answered on 14 Jul 2010, 04:30 PM
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
0
Triet Nguyen Cong
Top achievements
Rank 2
answered on 19 Jul 2010, 11:55 AM
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.
0
Alex
Telerik team
answered on 21 Jul 2010, 03:20 PM
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
0
Triet Nguyen Cong
Top achievements
Rank 2
answered on 23 Jul 2010, 07:47 AM
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?
0
Ivailo Karamanolev
Telerik team
answered on 28 Jul 2010, 12:20 PM
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
0
Triet Nguyen Cong
Top achievements
Rank 2
answered on 02 Aug 2010, 04:48 AM

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...'…

0
Accepted
Vesko
Telerik team
answered on 02 Aug 2010, 05:12 PM
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
0
lori guymon
Top achievements
Rank 1
answered on 16 Aug 2010, 07:46 PM
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!
0
Mike
Telerik team
answered on 17 Aug 2010, 04:54 PM
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
0
Inbal
Top achievements
Rank 1
answered on 14 Apr 2011, 09:23 PM
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
0
Mike
Telerik team
answered on 20 Apr 2011, 08:37 AM
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
Tags
General Discussions
Asked by
Triet Nguyen Cong
Top achievements
Rank 2
Answers by
Mike
Telerik team
Triet Nguyen Cong
Top achievements
Rank 2
Alex
Telerik team
Ivailo Karamanolev
Telerik team
Vesko
Telerik team
lori guymon
Top achievements
Rank 1
Inbal
Top achievements
Rank 1
Share this question
or