Improve loading speed of richtextboxes

4 posts, 0 answers
  1. Grigory
    Grigory avatar
    7 posts
    Member since:
    Feb 2015

    Posted 21 May 2015 Link to this post

    In my application I have a datagrid and one of the column is a column with a richtextbox. There are about 30 rows in the datagrid and loading of each richtextbox take some time, so loading of 30 richtextboxes take a lot of time. 

    Is there any way to improve loading speed of datagrid with richtextboxes? Maybe they can use the same background logic instead of separated for each item.

    If it could help, at the same time only one richtextbox can be editable. So, by default row is read only, but user can edit only one at the same time.

     Thanks

     

    Best Regards,

    Grigory

  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 25 May 2015 Link to this post

    Hello Grigory,

    RadRichTextBox is a complex control which exposes many features which makes it somewhat heavy. Since the control is intended as a word editor, similar to MS Word for example, it is not really targeted for cases in which you can place many instances of it on the same view. You can take a look at the Performance article to see whether some of the tips would help in your scenario, but I'm afraid there isn't much we can do to help in this case.

    On the other hand, depending on the format in which you preserve the data, you could use RadRichTextBox only for the editable instance in your view and show the other rows in another control. RadRichTextBox exposes a format provider that allows converting the document to the native FlowDocument, so maybe that could fit your needs.
    MsRichTextBoxXamlFormatProvider provider = new MsRichTextBoxXamlFormatProvider();
      
    string content = provider.Export(this.radRichTextBox.Document);
    FlowDocument flowDoc = provider.ExportToFlowDocument(this.radRichTextBox.Document);
    RichTextBox box = provider.ExportToRichTextBox(this.radRichTextBox.Document);

    Note that as FlowDocument lacks many of the features available in RadDocument, so it is possible to experience some loss of formatting if you choose this approach.

    I hope this is useful.

    Regards,
    Petya
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Grigory
    Grigory avatar
    7 posts
    Member since:
    Feb 2015

    Posted 25 May 2015 in reply to Petya Link to this post

    Hello Petya,

     

    Thank you for the response. I will try your approach.

     

    Regards,

    Grigory

  5. Grigory
    Grigory avatar
    7 posts
    Member since:
    Feb 2015

    Posted 25 May 2015 in reply to Petya Link to this post

    Hello Petya,

     

    Thank you for the response. I will try your approach.

     

    Regards,

    Grigory

Back to Top