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

Extreme bloat with HTML provider

3 Answers 31 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
John E.
Top achievements
Rank 1
John E. asked on 15 Jun 2015, 03:38 PM

Greetings-

We are using the RichTextBox to edit/display HTML content that is stored in SharePoint.  Each time the content is bound and rendered in the RichTextBox, the size grows exponentially.  We would not have noticed the issue if it were not for the fact that the text has gotten so large, SharePoint is rejecting the post of data, which has broken our application in production.  I would have attached a zipped version of the HTML that was generated, but that isn't supported.  It looks like several redundant styles are being created - you have to get past line 32000 to get to the body of the HTML.  When you get toward the end of the styles, you end up with style names like ".TableNormalParagraphParagraphParagraphCharacterParagraphCharacterCharacterCharacterCharacterCharacterCharacter". 

 

Is this a known issue or is there a new setting I have missed?  We're using version "UI for Silverlight Q3 2014 SP1".

 

Thanks in advance for your time and advice!

 

3 Answers, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 18 Jun 2015, 06:55 AM
Hello John,

I couldn't manage to reproduce the described behavior. My test scenario is:
  1. Adding content (paragraph, tables lists, applying styles)
  2. Save to Html.
  3. Open the saved file.
  4. Add content.
  5. Repeat same steps multiple times.

Could you provide more information on what steps we need to follow in order to reproduce the described issue.

Regards, Mihail
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
John E.
Top achievements
Rank 1
answered on 26 Jun 2015, 01:43 PM

Mihail-

Thank you for the reply.  Your steps seem accurate.  The only difference is that we're reading/writing the HTML to/from a SharePoint list.  Each time that we read/write from the list, the control creates another set of styles that is unique from the previous version.  At one point, we had a single field that was 10mb in size with 9.9mb being style declaration.  The fix for us has been to modify the HtmlDataProvider settings.  I added the following and fields that were previously 10mb, are now 2k:

 

<documentsHtml:HtmlDataProvider x:Name="BranchChiefDataProvider"
                                                        Html="{Binding Path=Item.BranchChiefInstructions,
                                                                       Mode=TwoWay}"
                                                        RichTextBox="{Binding ElementName=RrtbBranchChiefInstructions}"
                                                        SetupDocument="HtmlDataProviderSetupDocument">
                            <telerik:HtmlDataProvider.FormatProvider>
                                <telerik:HtmlFormatProvider>
                                    <telerik:HtmlFormatProvider.ImportSettings>
                                        <telerik:HtmlImportSettings UseDefaultStylesheetForFontProperties="True" />
                                    </telerik:HtmlFormatProvider.ImportSettings>
                                    <telerik:HtmlFormatProvider.ExportSettings>
                                        <telerik:HtmlExportSettings StyleRepositoryExportMode="DontExportStyles" StylesExportMode="Inline" />
                                    </telerik:HtmlFormatProvider.ExportSettings>
                                </telerik:HtmlFormatProvider>
                            </telerik:HtmlDataProvider.FormatProvider>
                        </documentsHtml:HtmlDataProvider>

 Since there is a workaround, we've resolved our production issue, but it would be nice to know what the root cause was.  The only other piece of information is that we recently upgraded from the Silverlight 4 Telerik controls to the Silverlight 5 version.

 

Thanks in advance for your time!

0
Accepted
Mihail
Telerik team
answered on 01 Jul 2015, 08:35 AM
Hello John,

Thank you for the reply.

I have noticed that you are using SetupDocument="HtmlDataProviderSetupDocument". This method will be called every time the RichTextBox is shown or the html source property is changed outside the HtmlDataProvider. If you add any content or styling on that method it could lead to bigger and bigger document each time the same document is shown in RadRichTextBox using this HtmlDataProvider.
Restricting the styles to be exported only as inline styling could lead to less content as each element has limited number of style properties.

If you want to isolate from where the problem is coming my recommendation is to start from the basic banding with RichTextBox and HtmlDataProvider. We have such demo project as SDK example, which you could use as a starting point. Customizing the project on one step at a time by adding the additional functionality you have should show you what is causing the problem.

I hope this information is helpful for you. In case you find any unexpected behavior or you have further questions feel free to contact us again.

Regards,
Mihail
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
John E.
Top achievements
Rank 1
Answers by
Mihail
Telerik team
John E.
Top achievements
Rank 1
Share this question
or