Hello,
We are using RadControls for WPF Q3 2011.2.712.40 Runtime version v4.0.30319 and we are facing a problem with printing using RadRichTextBox control.
The code using to print (as shown on your Website) is :
Telerik.Windows.Documents.UI.PrintSettings printSettings = new Telerik.Windows.Documents.UI.PrintSettings();
printSettings.PrintMode = Telerik.Windows.Documents.UI.PrintMode.Native;
printSettings.PrintScaling = Telerik.Windows.Documents.UI.PrintScaling.None;
MyRichTextBox.Print(printSettings);
And I’m getting the following error :
at Telerik.Windows.Documents.UI.HeaderFooterPresenterBase.UpdateBody() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\HeaderFooterPresenterBase.cs:line 338
at Telerik.Windows.Documents.UI.HeaderFooterPresenterBase.OnApplyTemplate() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\HeaderFooterPresenterBase.cs:line 417
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at Telerik.Windows.Documents.UI.DocumentPrintPresenter.MeasureOverride(Size availableSize) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\DocumentPrintPresenter.cs:line 455
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()
at Telerik.Windows.Documents.UI.DocumentPrintPresenter.UpdateEditorLayout() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\DocumentPrintPresenter.cs:line 308
at Telerik.Windows.Documents.UI.DocumentPrintPresenter.DoOnDocumentChanged() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\DocumentPrintPresenter.cs:line 301
at Telerik.Windows.Documents.UI.DocumentPrintPresenter.OnOwnerChanged() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\DocumentPrintPresenter.cs:line 283
at Telerik.Windows.Documents.UI.DocumentPrintPresenter.set_Owner(RadRichTextBox value) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\DocumentPrintPresenter.cs:line 102
at Telerik.Windows.Controls.RadRichTextBox.InitActiveEditorPresenter() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\RadRichTextBox.cs:line 2862
at Telerik.Windows.Controls.RadRichTextBox.set_ActiveEditorPresenter(IDocumentEditorPresenter value) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\RadRichTextBox.cs:line 1010
at Telerik.Windows.Controls.RadRichTextBox.<>c__DisplayClass22.<Print>b__20(Object o, EventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\RadRichTextBox.cs:line 2391
at Telerik.Windows.Documents.UI.DocumentPrintPresenter.OnPrintingStarted() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\DocumentPrintPresenter.cs:line 702
at Telerik.Windows.Documents.UI.DocumentPrintPresenter.Print() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\DocumentPrintPresenter.cs:line 654
at Telerik.Windows.Controls.RadRichTextBox.Print(PrintSettings printSettings) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Documents\UI\RadRichTextBox.cs:line 2411
at Optivia.WpfClient.Views.UserControls.CourrierType.UpdateCourrierTypeViewModel.ExportCourrierType(RadRichTextBoxBindable RTB) in C:\Projects\Eurovia_SSO\Optivia\Code\Optivia.WpfClient\Views\UserControls\CourrierType\UpdateCourrierTypeViewModel.cs:line 200
at GalaSoft.MvvmLight.Command.RelayCommand`1.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Telerik.Windows.Controls.RadButton.OnClick() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Controls\Buttons\RadButton.cs:line 357
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
The print screen attached gives you a visual description of the error we are getting.
We had tried to pass by HTML to do the job, but, and for client desire reason, we must pass by the control printing tool.
Thank you so much for your time.
Best regards
Telerik.Windows.Documents.Model.Span spn =
new
Telerik.Windows.Documents.Model.Span();
spn.Text = rnd.Next().ToString()+
"[]"
;
spn.FontWeight = FontWeights.SemiBold;
spn.Cursor = Cursors.Hand;
selectedpara.Children.AddAfter(currentspan, spn);
<
telerik:RadPane
Style
=
"{StaticResource RadPaneHeaderStyle}"
>
<
Style
x:Key
=
"RadPaneHeaderStyle"
TargetType
=
"telerik:RadPane"
>
<
Setter
Property
=
"Header"
Value
=
"{Binding HeaderTitle, Mode=TwoWay}"
/>
<
Setter
Property
=
"HeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding}"
ToolTip
=
"{Binding}"
/>
</
StackPanel
>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>