Telerik RichTextBox feasibility

8 posts, 0 answers
  1. udaybhaskar
    udaybhaskar avatar
    10 posts
    Member since:
    Aug 2010

    Posted 28 Jul 2011 Link to this post

    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
  2. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 29 Jul 2011 Link to this post

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

  3. DevCraft banner
  4. udaybhaskar
    udaybhaskar avatar
    10 posts
    Member since:
    Aug 2010

    Posted 01 Aug 2011 Link to this post

    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

  5. Ivailo Karamanolev
    Admin
    Ivailo Karamanolev avatar
    276 posts

    Posted 03 Aug 2011 Link to this post

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

  6. Paul
    Paul avatar
    37 posts
    Member since:
    May 2009

    Posted 04 Oct 2011 Link to this post

    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

  7. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 05 Oct 2011 Link to this post

    @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.
  8. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 10 Oct 2011 Link to this post

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

  9. Paul
    Paul avatar
    37 posts
    Member since:
    May 2009

    Posted 10 Oct 2011 Link to this post

    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
Back to Top
DevCraft banner