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

Telerik RichTextBox feasibility

7 Answers 136 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
udaybhaskar
Top achievements
Rank 1
udaybhaskar asked on 28 Jul 2011, 06:34 AM
Hi Telerik Team,

I am currently evaluating the Telerik RichTextBox for its feasibilty/functioanlity over TxTextControl which we are currently using in our product. We are planning to replace TxText with RadRichTextBox if we are able to achieve all the functionalities we are currently achieving through TxText. We are already using many other Telerik controls in our product.

There are many a features we are using in TxText, and as part of my analysis so far, I found few functionalities that are available in TxText are not there in Telerik mainly like...Processing the Documents server side without having UI needed..in TxText we will achieve this using ServerTextControl API. There is no UI for this control and we can do almost everything with this
But I didn't find a similar API/Control in Telerik to achieve this.
I guess we can use RadDocument in someway to load a document and do some processing, but finally we have to load that RadDocument into RadRichTextBox to print, create Headers&Footers etc.
I just want to know, whether it is possible that without UI can we load, edit, merge/append, mailmerge, print documents in Telerik.

Correct me If I am wrong and any other help regarding this will help me to create a feasibilty report on RichTextBox.

Regards,
Uday

7 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 29 Jul 2011, 01:25 PM
Hi Udaybhaskar,

We are shipping a version of the controls for WPF which you can use in an ASP.NET context. That said, you do not need an actual UI to use RadDocument and/or RadRichTextBox on the server side. You can do any processing you like, including the operations you mentioned, server-side just as you would client-side. The only requirement is that the thread is with single-threaded apartment state, but this is easy to achieve by starting a new thread with the required settings for example.

Kind regards,
Ivailo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
udaybhaskar
Top achievements
Rank 1
answered on 01 Aug 2011, 05:39 AM

Hi Iva,

 

Thanks for the Response.
Is the one you said is valid for current (2011 Q2) version of WPF RichTextBox, or you are going to implement that in the future releases. If it is applicable for the current release, can you attach a sample application which implements WPF RTB in an ASP.NET application.

Thanks,
Uday

0
Ivailo Karamanolev
Telerik team
answered on 03 Aug 2011, 03:57 PM
Hello Udaybhaskar,

We have prepared a small demo about document processing on the server. Let us know if you have any additional questions.

Greetings,
Ivailo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Paul
Top achievements
Rank 1
answered on 04 Oct 2011, 11:57 PM

Hello,

Need to make a comment on this server-side approach.  In our situtation, we have a large Silverlight application talking to backend WCF services (hosted in IIS but not on the same port as the SL web site).  We need to take rtf content, radDocument xaml content loading from the database and convert it to plain text to show a quick preview of that content in radGridViews.  At first we tried to do it on the client Silverlight side but ran into major performance issues when loading the grids because of this conversion.  Therefore we decided to try to call a WPF assembly from our WCF layer but we get exceptions that "The calling thread must be STA, because many UI components require this."  These exceptions were raised in "Telerik.Windows.Documents.Layout.RadTextMeasurerSL" which I suspect is maybe doing some Arrange or Layout of the text.  See attached image for error encountered.

While it would be possible to spin up STA threads to convert this text, it just isn't realistic in a large enterprise application to make blocking calls on our MTA service layer.  Not to mention the concurrency issues we'd face with that.

So what do we truly need here?  A way to:

  • show a quick text preview of the rich text content in radGridViews. 
  • use the conversion routines in the format providers for rtf and Telerik-specific radDocument xaml but in a manner that does not require a STA thread.

Pending any rewrite of your providers, I'm going to have to rethink what we are trying to accomplish strategically here.

Regards,
Paul

0
hwsoderlund
Top achievements
Rank 1
answered on 05 Oct 2011, 10:37 AM
@Paul:
We "solve"  this issue by converting the documents to plain text on the client before creating and updating the documents. Then we save the rich text XAML and the plain text version in two separate db columns. This might not be suitable for your scenario, especially if you already have large amounts of existing data. For us, however, this approach has worked quite well. One reason that we needed it was to be able to send out the plain text in e-mail messages.
0
Iva Toteva
Telerik team
answered on 10 Oct 2011, 04:16 PM
Hello Paul,

When importing a document, some of the UI elements that are needed for its visualization are created right away. Therefore, for now it will not be possible to import a document on a thread that is not STA. We are working on removing this limitation. The first step that was done in order to allow import of documents off thread was that the document elements are not dependency objects any more (starting from the latest official release - 2011.2.920).
Currently, the import will fail if there are images or tables in the document and the thread is not STA. Once we have resolved this limitation, it would be possible to create a format provider similar to TxtFormatProvider, which returns a plain text representation of the document.

Until then, the only solution would be the one that hwsoderlund has suggested.

Regards,
Iva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Paul
Top achievements
Rank 1
answered on 10 Oct 2011, 05:24 PM
Thank you Iva. 

I'll will be watching for news of a non-STA release.  Until then we are following an approach similar to what hwsoderlund suggested.

Best Regards,
Paul
Tags
RichTextBox
Asked by
udaybhaskar
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
udaybhaskar
Top achievements
Rank 1
Paul
Top achievements
Rank 1
hwsoderlund
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or