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

Improve loading speed of richtextboxes

3 Answers 171 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Grigory
Top achievements
Rank 2
Grigory asked on 21 May 2015, 06:21 AM

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

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 25 May 2015, 04:40 PM
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
0
Grigory
Top achievements
Rank 2
answered on 25 May 2015, 05:17 PM

Hello Petya,

 

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

 

Regards,

Grigory

0
Grigory
Top achievements
Rank 2
answered on 25 May 2015, 05:18 PM

Hello Petya,

 

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

 

Regards,

Grigory

Tags
RichTextBox
Asked by
Grigory
Top achievements
Rank 2
Answers by
Petya
Telerik team
Grigory
Top achievements
Rank 2
Share this question
or