Telerik Forums
UI for WPF Forum
3 answers
222 views

Hi everybody,

when i export a document to pdf without a watermark, the there are no problems.

But when i add a watermark text and then try to export it, then the program crashes.

Here i create a draft document.

private void CreateDraft()
{
    WatermarkTextSettings watermark = new WatermarkTextSettings();
    watermark.ForegroundColor = Colors.Gray;
    watermark.Opacity = 1.0d;
    watermark.RotateAngle = 315.0d;
    watermark.Text = "Vorabexemplar";
 
    this.rtbResult.SetWatermarkText(watermark);
     
    this.UpdatePdfViewer();
}

 

After adding the watermark the pdf viewer needs to be updated to set the results:

private void UpdatePdfViewer()
{
    RadDocument doc = this.rtbResult.Document;
     
    var pdfProvider = new PdfFormatProvider();
    var outputStream = new MemoryStream();
 
    pdfProvider.Export(doc, outputStream);
 
    this.rtbResult.UpdateEditorLayout();
 
    this.pdfViewer.DocumentSource = new PdfDocumentSource(outputStream);
    this.pdfViewer.DocumentSource.Loaded += (s, e) => { outputStream.Close(); };
}

 

Everthing works fine without watermark. With watermark the programm crashs on line pdfProvider.Export(doc, outputStream);

I've also tryed the solution in the following thread without success Mail Merge - PDF Export - Watermark problem

 

Full error message

bei Telerik.Windows.Documents.UI.UIProviders.WatermarkUIProvider.Arrange(UILayerUpdateContext uILayerUpdateContext)
bei Telerik.Windows.Documents.UI.Layers.ProviderUILayerBase.ArrangeChildren()
bei Telerik.Windows.Documents.UI.DocumentPagePresenter.ArrangeUILayers()
bei Telerik.Windows.Documents.UI.DocumentPagePresenter.MeasureOverride(Size availableSize)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
bei System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Control.MeasureOverride(Size constraint)
bei Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.MeasureOverride(Size availableSize)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
bei System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.ContextLayoutManager.UpdateLayout()
bei System.Windows.UIElement.UpdateLayout()
bei Telerik.Windows.Documents.UI.DocumentPresenterBase.Telerik.Windows.Controls.IDocumentEditorPresenter.UpdateLayout()
bei Telerik.Windows.Controls.RadRichTextBox.<>c__DisplayClass20.<UpdateEditorLayout>b__1f()
bei Telerik.Windows.Controls.RadRichTextBox.UpdateEditorLayout(Boolean focusCarret, Boolean updateCaretSize, Boolean async)
bei Telerik.Windows.Controls.RadRichTextBox.UpdateEditorLayout(Boolean async)
bei Telerik.Windows.Controls.RadRichTextBox.UpdateEditorLayout()
bei Telerik.Windows.Controls.RadRichTextBox.Document_LayoutModeChanged(Object sender, EventArgs e)
bei Telerik.Windows.Documents.Model.RadDocument.OnLayoutModeChanged()
bei Telerik.Windows.Documents.Model.RadDocument.set_LayoutMode(DocumentLayoutMode value)
bei Telerik.Windows.Documents.FormatProviders.Pdf.RadDocumentPreparer..ctor(RadDocument document)
bei Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider.Export(RadDocument document, Stream output)
bei LvsDocumentEngine.Gui.Dialogs.CreateDocumentDialog.UpdatePdfViewer() in d:\Projekte\Kunden\METAX GmbH\Metax-ERP\LvsDocumentEngine\Gui\Dialogs\CreateDocumentDialog.xaml.cs:Zeile 121.
bei LvsDocumentEngine.Gui.Dialogs.CreateDocumentDialog.btnCreateDraft_Click(Object sender, RoutedEventArgs e) in d:\Projekte\Kunden\METAX GmbH\Metax-ERP\LvsDocumentEngine\Gui\Dialogs\CreateDocumentDialog.xaml.cs:Zeile 303.
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
bei System.Windows.Controls.Primitives.ButtonBase.OnClick()
bei System.Windows.Controls.Button.OnClick()
bei Telerik.Windows.Controls.RadButton.OnClick()
bei System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
bei System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
bei System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
bei System.Windows.Input.InputManager.ProcessStagingArea()
bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
bei System.Windows.Window.ShowHelper(Object booleanBox)
bei System.Windows.Window.Show()
bei System.Windows.Window.ShowDialog()
Martin Ivanov
Telerik team
 answered on 31 Mar 2017
5 answers
1.2K+ views

Hi,

Is it possible to show validation tooltip when control has focus in Windows8 theme just like it is in Windows8Touch theme?

It is hard for my users to know that they have to hover over this very small triangle for more information about validation error.

 

Evgenia
Telerik team
 answered on 31 Mar 2017
1 answer
219 views

I'm trying to build a RadPaneGroup with TabStripPlacement="Bottom" inside another RadPaneGroup with with TabStripPlacement="Top".
I have tried this by placing a RadDocking inside another (see below), but there are two problems with this:

Problem 1:
For some reason, [ TabStripPlacement="Bottom" ] seems to be ignored, as the inner-most TabStrip is placed at the Top.

Problem 2:
Furthermore, if I drag one of the inner RadPanes and make it floating, and then I try and dock it back where it was, it simply disappears.

        <telerik:RadDocking x:Name="OuterDock">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadPaneGroup Name="paneGroup2" telerik:ProportionalStackPanel.RelativeSize="350,350">
                    <telerik:RadPane Header="A">
                        <telerik:RadDocking x:Name="NestedDock">
                            <telerik:RadDocking.DocumentHost>
                                <telerik:RadPaneGroup TabStripPlacement="Bottom" >
                                    <telerik:RadPane x:Name="B1" Header="B1">
                                        <Label Content="B1"/>
                                    </telerik:RadPane>
                                    <telerik:RadPane x:Name="B2" Header="B2">
                                        <Label Content="B2"/>
                                    </telerik:RadPane>
                                </telerik:RadPaneGroup>
                            </telerik:RadDocking.DocumentHost>
                        </telerik:RadDocking>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadDocking.DocumentHost>
        </telerik:RadDocking>

 

Is there a way to achieve the desired result, without encountering these issues ?

 

Nasko
Telerik team
 answered on 31 Mar 2017
0 answers
110 views
The height of the Error tool tip is the same as the row's height. Is there a way to not limit it to the row's height?

https://snag.gy/tID0f9.jpg
band
Top achievements
Rank 1
 asked on 31 Mar 2017
1 answer
154 views

Hello,

I'm trying to put png icons on the PinPointTemplate and I achieved it but it goes big enough as the half of my screen, I tried to do ImageScale but it only fits the image (16x16 png) but the square around is still big, when I put Width and Height the point loses the location on different zooms. Please help, leave you part of my code.

 

<DataTemplate x:Key="PinPointTemplate">
            <telerik:MapPinPoint telerik:MapLayer.Location="{Binding Path=Location}" 
                                 Background="{Binding Background}"
                                 BorderBrush="Black"
                                 BorderThickness="1" 
                                 ImageSource="{Binding Icon}"
                                 ImageScale = "0.1"
                                 Width="20" Height="20">
                <ToolTipService.ToolTip>
                    <ToolTip Content="{Binding Path=Caption}"/>
                </ToolTipService.ToolTip>
            </telerik:MapPinPoint>
           
        </DataTemplate>
Martin Ivanov
Telerik team
 answered on 30 Mar 2017
3 answers
173 views
We have a RadDocking version 2013.1.220.40 with two floating RadPanes. Both RadPanes have as content another RadDocking with a layout.
When one of the two RadPanes comes on top of each other and the Compass appears we get the following exception:

 System.InvalidOperationException: The specified Visual and this Visual do not share a common ancestor, so there is no valid transformation between the two Visuals.
   at System.Windows.Media.Visual.TransformToVisual(Visual visual)
   at Telerik.Windows.Controls.RadDocking.GetElementPositionAtHost(FrameworkElement host, FrameworkElement element)
   at Telerik.Windows.Controls.RadDocking.MoveCompassToElement(FrameworkElement element)
   at Telerik.Windows.Controls.RadDocking.ShowCompass()
   at Telerik.Windows.Controls.RadDocking.OnDragElement(FrameworkElement draggedElement, Point relativeMousePosition, RadPaneGroup targetPaneGroup)
   at Telerik.Windows.Controls.RadDocking.OnDragContainer(RadSplitContainer container, Point globalMousePosition)
   at Telerik.Windows.Controls.RadDocking.OnToolWindowDrag(ToolWindow window, Point globalMousePosition)
   at Telerik.Windows.Controls.Docking.ToolWindow.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize)
   at Telerik.Windows.Controls.WindowBase.Telerik.Windows.Controls.InternalWindow.IDragAware.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize)
   at Telerik.Windows.Controls.InternalWindow.WindowHostBase.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize)
   at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.OnWindowPositionUpdating(Rect windowPosition)
   at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.HandleMoving(IntPtr hwnd, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(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)
   at System.Windows.Media.Visual.TransformToVisual(Visual visual)
   at Telerik.Windows.Controls.RadDocking.GetElementPositionAtHost(FrameworkElement host, FrameworkElement element)
   at Telerik.Windows.Controls.RadDocking.MoveCompassToElement(FrameworkElement element)
   at Telerik.Windows.Controls.RadDocking.ShowCompass()
   at Telerik.Windows.Controls.RadDocking.OnDragElement(FrameworkElement draggedElement, Point relativeMousePosition, RadPaneGroup targetPaneGroup)
   at Telerik.Windows.Controls.RadDocking.OnDragContainer(RadSplitContainer container, Point globalMousePosition)
   at Telerik.Windows.Controls.RadDocking.OnToolWindowDrag(ToolWindow window, Point globalMousePosition)
   at Telerik.Windows.Controls.Docking.ToolWindow.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize)
   at Telerik.Windows.Controls.WindowBase.Telerik.Windows.Controls.InternalWindow.IDragAware.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize)
   at Telerik.Windows.Controls.InternalWindow.WindowHostBase.OnDragDelta(Point globalMousePosition, Rect initialRect, Rect destinationRect, Boolean isResize)
   at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.OnWindowPositionUpdating(Rect windowPosition)
   at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.HandleMoving(IntPtr hwnd, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at Telerik.Windows.Controls.InternalWindow.ChromelessWindowHelper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(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)

We tried disabling the compass by using the PreviewShowCompass event, but that event is never called.

 

private void dockPanel_PreviewShowCompass(object sender, Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs e)
       {
           e.Compass.IsLeftIndicatorVisible = false;
           e.Compass.IsTopIndicatorVisible = false;
           e.Compass.IsRightIndicatorVisible = false;
           e.Compass.IsBottomIndicatorVisible = false;
           e.Compass.IsCenterIndicatorVisible = false;
 
       } // dockPanel_PreviewShowCompass


I think the InvalidOperationException exception and the fact the PreviewShowCompass isn't called should be fixed by Telerik.
Meanwhile Is there any workaround we can use?

Nasko
Telerik team
 answered on 30 Mar 2017
13 answers
656 views

It seems like if I add different aggregate functions to the different columns, all columns gets all aggregate functions. Is there any way to prevent this?

 

(For instance - I would like some of the columns group header to include the column header - but not for all columns)

 

Thanks

Inger Marie

 

Inger Marie
Top achievements
Rank 1
 answered on 29 Mar 2017
1 answer
162 views
Hi,

It appears that the GridView is being rendered differently on a touch enabled device as opposed to a normal PC.  See attached screenshots.  It this expected?  Is there a way to disable touch such that it renders the same on both devices (I've tried using the touch manager without success)?  Am I barking up the wrong tree i.e. does it somehow relate the performance of the PC and / or graphics card?

You will note from the screenshots that I have 2 gridviews (one horizontal and one vertical).  They are precisely placed such that columns on the horizontal gridview align with the row of the vertical gridview (scrolling is synchronised).  This works perfectly on my development PC however on my surface pro it renders differently such that the gridviews don't align. 

Note that misalignment / different rendering seems to be originating from the customs styles I have developed (HeaderCellStyle, HeaderRowStyle and CellStyle).  Note the inconsistent border thicknesses.

Note that am I using the latest binaries (R1 2017) on both machines.

Please advise.

Thanks

Ian

Stefan Nenchev
Telerik team
 answered on 29 Mar 2017
3 answers
292 views

I have a RadGridView with FrozenColumnCount=4

When I group, the group header contains an aggregate count function.

But when I scroll to the right - the group header aggregate count is also scrolled away from view. I can still see the group header.

Is there any way to fix that?

I define the Group aggregate on the first column, like this:

<telerik:GridViewDataColumn.AggregateFunctions>
    <telerik:CountFunction  Caption="Count" ResultFormatString="{}: {0:#,0}"  />
</telerik:GridViewDataColumn.AggregateFunctions>

 

Thanks.

Inger Marie
Top achievements
Rank 1
 answered on 29 Mar 2017
1 answer
330 views
Is there any events are present in spreadsheet or based on selection only we have to figure it out about the selection
Dinko | Tech Support Engineer
Telerik team
 answered on 29 Mar 2017
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?