I exported HTML from the RadRichTextBox as a fragment and then later tried to import this fragment back into a new RadRichTextBox. It blows up with a null reference exception when I try to import it back in. It worked with no errors when I used the default export options. Are fragments not possible to round trip with RadRichTextBox?
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ConvertToFontStyle(Object value)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.CreateSpanFromTextNode(INode childNode)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessContentNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessParagraphNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.Import(Stream input)
at Telerik.WinControls.RichTextBox.FileFormats.Html.HtmlFormatProvider.Import(Stream input)
at Telerik.WinControls.RichTextBox.FileFormats.Html.HtmlFormatProvider.Import(String input)
at Documents._list_SelectedValueChanged(Object sender, EventArgs e) in DocumentsTab.cs:line 99
Fragment contents:
HtmlFormatProvider prov =
new
HtmlFormatProvider();
prov.ExportSettings =
new
HtmlExportSettings()
{
DocumentExportLevel = DocumentExportLevel.Fragment,
StylesExportMode = StylesExportMode.Inline
};
string
data = prov.Export( _editor.Document );
// later...
HtmlFormatProvider prov2 =
new
HtmlFormatProvider();
_editor.Document = prov2.Import( data );
// this line gets the null reference exception at the location below
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ConvertToFontStyle(Object value)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.CreateSpanFromTextNode(INode childNode)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessContentNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessParagraphNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessGenericNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.<>c__DisplayClass3.<ProcessNode>b__2()
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.ProcessNode(INode node)
at Telerik.WinControls.RichTextBox.FileFormats.Html.Import.HtmlDocumentImporter.Import(Stream input)
at Telerik.WinControls.RichTextBox.FileFormats.Html.HtmlFormatProvider.Import(Stream input)
at Telerik.WinControls.RichTextBox.FileFormats.Html.HtmlFormatProvider.Import(String input)
at Documents._list_SelectedValueChanged(Object sender, EventArgs e) in DocumentsTab.cs:line 99
Fragment contents:
<
p
style
=
"margin: 0px 0px 0px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px;"
>
<
span
style
=
"font-family: 'Arial';font-style: ;font-weight: bold;font-size: 13.33333px;color: #000000;text-decoration: underline;"
>High return net</
span
>
</
p
>
<
p
style
=
"margin: 0px 0px 0px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px;"
>
<
span
style
=
"font-family: 'Arial';font-style: ;font-weight: bold;font-size: 13.33333px;color: #000000;text-decoration: underline;"
>High return gross</
span
>
</
p
>
<
p
style
=
"margin: 0px 0px 0px 0px;text-align: left;text-indent: 0pt;padding: 0px 0px 0px 0px;"
>
<
span
style
=
"font-family: 'Arial';font-style: normal;font-size: 13.33333px;color: #000000;"
>See handbook page 128</
span
>
</
p
>