This question is locked. New answers and comments are not allowed.
Hi,
I am trying to import HTML into a RichTextBox using HtmlFormatProvider.
It is throwing an exception
This is my XAML
This is the HTML i am trying to import
This is the Stack Trace.
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
at System.Windows.UIElement.UpdateLayout()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.UpdateEditorLayout()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.DoOnDocumentChanged()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.OnOwnerChanged()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.set_Owner(RadRichTextBox value)
at Telerik.Windows.Controls.RadRichTextBox.InitActiveEditorPresenter()
at Telerik.Windows.Controls.RadRichTextBox.set_Document(RadDocument value)
at SilverlightApplication1.MainPage.Button_Click_1(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
Thanks !
I am trying to import HTML into a RichTextBox using HtmlFormatProvider.
It is throwing an exception
{System.NullReferenceException: Object reference not set to an instance of an object.
This is the Code i am usingvar provider = new HtmlFormatProvider(); OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Multiselect = false; bool? dialogResult = openDialog.ShowDialog(); if (dialogResult == true) { using (FileStream stream = openDialog.File.OpenRead()) { stream.Seek(0, SeekOrigin.Begin); rich.Document = provider.Import(stream); } }<Controls:RadRichTextBox x:Name="rich" > <Controls:RadRichTextBox.Document> <Model:RadDocument> </Model:RadDocument> </Controls:RadRichTextBox.Document> </Controls:RadRichTextBox>This is the HTML i am trying to import
<HTML> <BODY> Test Html </BODY> </HTML>This is the Stack Trace.
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
at System.Windows.UIElement.UpdateLayout()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.UpdateEditorLayout()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.DoOnDocumentChanged()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.OnOwnerChanged()
at Telerik.Windows.Documents.UI.DocumentPresenterBase.set_Owner(RadRichTextBox value)
at Telerik.Windows.Controls.RadRichTextBox.InitActiveEditorPresenter()
at Telerik.Windows.Controls.RadRichTextBox.set_Document(RadDocument value)
at SilverlightApplication1.MainPage.Button_Click_1(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
Thanks !