This is a migrated thread and some comments may be shown as answers.

RadSyntaxEditor throws ArgumentException when Size set to 50% or lower.

1 Answer 109 Views
SyntaxEditor
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 14 May 2020, 08:45 PM

Hello,

We are using the RadSyntaxEditor (R1 2020). Everything has been good with it but I wanted to report a possible bug. It isn't affecting our users because they are old and all have bad eyes, but someone somewhere might care :)

We have found that we can scroll to make the text larger but that anytime we scroll to 50% or lower the following exception gets thrown:

 

   Exception    {"'∞' is not a valid value for property 'Y2'."}    System.Exception {System.ArgumentException}

   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.SyntaxEditor.UI.Margins.LineNumberMargin.UpdateUIOverride(UIUpdateContext updateContext)
   at Telerik.Windows.Controls.SyntaxEditor.UI.Margins.SyntaxEditorMarginsCollection.UpdateUI(UIUpdateContext updateContext)
   at Telerik.Windows.Controls.SyntaxEditor.UI.Margins.SyntaxEditorMargins.UpdateUI(UIUpdateContext updateContext)
   at Telerik.Windows.Controls.SyntaxEditor.Layout.SyntaxEditorLayout.Arrange()
   at Telerik.Windows.Controls.SyntaxEditor.UI.SyntaxEditorPresenter.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
   at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at Telerik.Windows.Controls.LayoutControl.VerticalLayoutControlPanelStrategy.Arrange(Size finalSize)
   at Telerik.Windows.Controls.LayoutControl.LayoutControlPanel.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
   at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.ScrollContentPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

The syntax editor sits in a LayoutControlGroup inside a vertically oriented RadLayoutControl. The abbreviated xaml code looks something like this below:

<telerik:LayoutControlGroup x:Name="TopLayout"
                                        Orientation="Vertical"
                                        Height="400"
                                        FocusManager.FocusedElement="{Binding ElementName=SyntaxEditor}">
                <telerik:RadToolBar ... />
                <telerik:RadSyntaxEditor Name="SyntaxEditor"
                                         IsTabStop="True"
                                         AcceptsReturn="True"
                                         Focusable="True"
                                         Language="Sql"
                                         CaretDisplayMode="Normal"
                                         KeyDown="SyntaxEditor_KeyDown"
                                         ScrollViewer.VerticalScrollBarVisibility="Visible"
                                         PreviewSyntaxEditorMouseLeftButtonDown="SyntaxEditor_PreviewSyntaxEditorMouseLeftButtonDown"
                                         SelectionChanged="SyntaxEditor_SelectionChanged"
                                         DocumentContentChanging="SyntaxEditor_DocumentContentChanging"/>
            </telerik:LayoutControlGroup>

 

Hope this helps.

Tim

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 18 May 2020, 07:11 AM

Hi Tim,

Thank you for reporting this issue. It was actually reported several weeks ago. Generally, RadSyntaxEditor should'n be placed in controls /panels which measure their children vertically with infinity. This should be considered an unsupported scenario leading to various performance issues. LayoutControl has built in scroll viewer and in this case you must provide Height to the RadSyntaxEditor in order to work properly. This is the general solution in these scenarios. Please also note that from R2 2020 onward,  RadSyntaxEditor will throw informative exception when placed in scrollviewer/stackpanel (other similar panel) and no height is set. Please excuse us for the inconvenience this causes in the previous versions.

Regards,
Petar Mladenov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
SyntaxEditor
Asked by
Tim
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or