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

RadRichTextBox slow constructor?

1 Answer 66 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 06 Jan 2016, 02:47 AM

Hi,

I have a datagrid that loads richtext as part of a celltemplate. The number of rows is < 20 however the performance is less than ideal ~5sec to render.

I have narrowed it down to the constructor of the RadRichTextBox. The RtfDataProvider does not seem to be degrading the performance.

I do not require the ribbon or spellcheck etc in this instance of the control however elsewhere in the application they have a full editor so any solution cannot be global.

Any ideas on how to improve speed?

Cheers

Jeremy

 

 <data:DataGridTemplateColumn Header="Commentary" Width="500">
                                                <data:DataGridTemplateColumn.CellTemplate>
                                                    <DataTemplate>
                                                    <StackPanel>
                                                            <!--<telerik1:RtfDataProvider x:Name="rtfDataProvider"
                                                                    Rtf="{Binding Path=ValueText, Mode=TwoWay}"
                                                                    RichTextBox="{Binding ElementName=radRichTextBox}" />-->
                                                    <telerik1:RadRichTextBox MaxWidth="500" Height="70" Style="{StaticResource RichTextBoxReadOnly}"  x:Name="radRichTextBox"/>
                                                    
                                                    </StackPanel>
                                            </DataTemplate>
                                                </data:DataGridTemplateColumn.CellTemplate>

 

    <Style x:Key="RichTextBoxReadOnly" TargetType="telerik:RadRichTextBox">
        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="IsContextMenuEnabled" Value="False"/>
        <Setter Property="IsImageMiniToolBarEnabled" Value="False"/>
        <Setter Property="IsTrackChangesEnabled" Value="False"/>
        <Setter Property="IsSpellCheckingEnabled" Value="False"/>
        <Setter Property="IsEnabled" Value="True"/>
    </Style>

1 Answer, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 08 Jan 2016, 02:21 PM
Hello Jeremy,

Thank you for contacting us.

Let me get straight to the question. By default, RadRichTextBox loads all the format providers in the referenced assemblies. If you don’t need them all, you could turn off the MEF and register only the used providers.  You can read more in Explicitly set the necessary types article. Or try to use the code snippet below.
.
DocumentFormatProvidersManager.AutomaticallyLoadFormatProviders = false;
this.radRichTextBox.IsSpellCheckingEnabled = false;
this.radRichTextBox.UILayersBuilder = new UILayersBuilder();
I hope this helps. Let me know if you need further assistance.

Regards,
Svetoslav
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
Tags
RichTextBox
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Share this question
or