Completed
Last Updated: 25 Jun 2018 10:17 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 31 May 2018 05:18
Category: RichTextEditor
Type: Bug Report
2
FIX. RadRichTextEditor - NullReferenceException is thrown when calling PrintPreview after an watermark is inserted in web layout mode
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinForms.Documents.UI.UIProviders.WatermarkUIProvider.Arrange(UILayerUpdateContext uILayerUpdateContext)
   at Telerik.WinForms.Documents.UI.Layers.ProviderUILayerBase.ArrangeChildren()
   at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.ArrnageUILayers()
   at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureChildren(SizeF availableSize)
   at Telerik.WinControls.RichTextEditor.UI.FrameworkElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.Telerik.WinForms.RichTextEditor.IDocumentEditorPresenter.UpdateLayout()
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.<>c__DisplayClass3.<UpdateEditorLayout>b__2()
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.UpdateEditorLayout(Boolean focusCarret, Boolean updateCaretSize, Boolean async)
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.set_ActiveEditorPresenter(IDocumentEditorPresenter value)
   at Telerik.WinForms.RichTextEditor.RadRichTextBox.Telerik.WinControls.UI.IPrintable.BeginPrint(RadPrintDocument sender, PrintEventArgs args)
   at Telerik.WinControls.UI.RadPrintDocument.OnBeginPrint(PrintEventArgs e)
   at System.Drawing.Printing.PrintDocument._OnBeginPrint(PrintEventArgs e)
   at System.Drawing.Printing.PrintController.Print(PrintDocument document)
   at System.Drawing.Printing.PrintDocument.Print()
   at System.Windows.Forms.PrintPreviewControl.ComputePreview()
   at System.Windows.Forms.PrintPreviewControl.CalculatePageInfo()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()


To reproduce: please refer to the attached gi file demonstrating how to replicate the problem with the Demo application.

Workaround:

        private void radRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
        {
            if (e.Command  is ChangeIntegratedWatermarkTypeCommand && this.radRichTextEditor1.LayoutMode!= Telerik.WinForms.Documents.Model.DocumentLayoutMode.Paged)
            {
                e.Cancel = true; 
            }
        }
Attached Files:
2 comments
ADMIN
Hristo
Posted on: 25 Jun 2018 10:17
Hi Bruce,

Thank you for your input. We have fixed the issue in the R2 SP1 release.

Regards,
Hristo
Bruce
Posted on: 01 Jun 2018 21:40
This issue is not only related to weblayout mode, as I am experience the issue with layoutmode Paged as well, sometimes, when you insert a watermark, the watermark will not be visible in the rad text editor, if you attempt to print preview this document is when this null reference is thrown.

The issue is between the radribbonbar and the radtexteditor, but I can't see any error leading up to the crash that is a result of print preview.