Table error

2 posts, 0 answers
  1. Dominic
    Dominic avatar
    3 posts
    Member since:
    Oct 2012

    Posted 26 Nov 2012 Link to this post

    I have a read-only RadRichTextBox control which contains several nested tables. When the user hovers the cursor over the tables an icon appears containing four arrows (presumably it is intended for moving and/or sizing the tables). When the user moves the cursor over the icon it produces the error below.
    My first priority is to prevent this error appearing, but I would also like to stop the icon appearing if possible, given that the document is readonly and so the user is not permitted to resize or move any of the tables.
    Length cannot be less than zero
    Parameter name: length

    Error Details
       at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
       at System.String.Substring(Int32 startIndex, Int32 length)
       at Telerik.Windows.Documents.Layout.SpanLayoutBox.BinarySearchSplitIndex(SpanLayoutBox spanBox, Single availableWidth)
       at Telerik.Windows.Documents.SpanBoxPositionHandler.MoveToLocation(PointF location)
       at Telerik.Windows.Documents.DocumentPosition.SetPosition(PointF position, Boolean MoveToNextIfOutOfBox)
       at Telerik.Windows.Documents.UI.DocumentPrintLayoutPresenter.GetDocumentPositionFromViewPoint(Point viewPoint)
       at Telerik.Windows.Documents.UI.Layers.TableDecorationLayers.TableMovement.TableMovementUILayer.OnMove(MouseEventArgs e)
       at Telerik.Windows.Documents.UI.Layers.TableDecorationLayers.TableMovement.TableMovementUILayer.<>c__DisplayClass2.<MouseMove>b__0()
       at Telerik.Windows.Documents.Utils.DelayedExecution.ExecuteAction(Boolean asynch)
       at Telerik.Windows.Documents.Utils.DelayedExecution.timer_Tick(Object sender, EventArgs e)
       at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
  2. Martin Ivanov
    Martin Ivanov avatar
    104 posts

    Posted 28 Nov 2012 Link to this post

    Hi Dominic,

    We haven't observed such an exception when hovering over the adorner. Can you please provide a document so we can isolate the issue and elaborate on the steps to reproduce the exception?

    When it comes to the current logic, we are not considering removing the layer when the document is read-only, as it also allows selecting the table (select and copy for example). 

    In the meantime, as a workaround you can disable the TableMovementLayer as follows:

    public MainPage()
        this.editor.UILayersBuilder = new CustomUILayerBuilder();
    class CustomUILayerBuilder : UILayersBuilder
        protected override void BuildUILayersOverride(IUILayerContainer uiLayerContainer)

    We will be waiting for your reply.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top