hi
i created a custom control in silverlight
when i added the control to richtextbox , it raised an error
System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_RemoveValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_RemoveDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.RemoveDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.RemoveInternal(UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Remove(T value)
at Telerik.Windows.Documents.UI.UILayer.AddChild(UIElement uiElement)
at Telerik.Windows.Documents.UI.UIInlinesLayer.UpdateUI()
at Telerik.Windows.Documents.UI.UILayer.UpdateViewPort(RectangleF viewPort)
at Telerik.Windows.Documents.UI.UILayer.UpdateViewPort(RectangleF viewPort, UIElementPool uiElementPool)
at Telerik.Windows.Documents.UI.DocumentPresenterBase.UpdateUILayersViewPortSize(RectangleF viewPort)
at Telerik.Windows.Documents.UI.DocumentPresenterBase.ArrangeOverride(Size finalSize)
at System.Windows.FrameworkElement.ArrangeOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)}
can some one please help me how to fix this
the code is :
thanks
i created a custom control in silverlight
when i added the control to richtextbox , it raised an error
System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_RemoveValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_RemoveDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.RemoveDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.RemoveInternal(UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Remove(T value)
at Telerik.Windows.Documents.UI.UILayer.AddChild(UIElement uiElement)
at Telerik.Windows.Documents.UI.UIInlinesLayer.UpdateUI()
at Telerik.Windows.Documents.UI.UILayer.UpdateViewPort(RectangleF viewPort)
at Telerik.Windows.Documents.UI.UILayer.UpdateViewPort(RectangleF viewPort, UIElementPool uiElementPool)
at Telerik.Windows.Documents.UI.DocumentPresenterBase.UpdateUILayersViewPortSize(RectangleF viewPort)
at Telerik.Windows.Documents.UI.DocumentPresenterBase.ArrangeOverride(Size finalSize)
at System.Windows.FrameworkElement.ArrangeOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)}
can some one please help me how to fix this
the code is :
Telerik.Windows.Documents.Model.
InlineUIContainer container = new Telerik.Windows.Documents.Model.InlineUIContainer();
container.UiElement = PlaceHolder;
Telerik.Windows.Documents.Model.
Section section = new Telerik.Windows.Documents.Model.Section();
Telerik.Windows.Documents.Model.
Paragraph paragraph = new Telerik.Windows.Documents.Model.Paragraph();
paragraph.Inlines.Add(container);
section.Paragraphs.Add(paragraph);
RadDocument document = new RadDocument();
document.Sections.Add(section);
MsWordExampleInstance.editor.Document = document;
thanks