Selection Exception

2 posts, 0 answers
  1. Ivan
    Ivan avatar
    1 posts
    Member since:
    Dec 2017

    Posted 19 Dec 2017 Link to this post

    Hi! Sometimes when I select some text in TextBox I get next error:

    System.ArgumentOutOfRangeException: Length cannot be less than zero.
    Parameter name: length
       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.Selection.MouseSelectionHandler.UpdateSelectionAndCaretPosition()
       at Telerik.Windows.Documents.Selection.MouseSelectionHandler.RegisterDocumentMouseMove(Point position, SourceType source)
       at Telerik.Windows.Documents.UI.DocumentPresenterBase.HandleMouseMoveOnPosition(Point position, SourceType source)
       at Telerik.Windows.Documents.UI.DocumentPresenterBase.Owner_MouseMove(Object sender, MouseEventArgs e)

    How I can catch this error for handling?
  2. Tanya
    Tanya avatar
    623 posts

    Posted 21 Dec 2017 Link to this post

    Hi Ivan,

    The error you are getting is pretty strange and we are not sure why it might occur. Is it possible to share an example document along with steps to reproduce the error so we can investigate it locally and try to propose a solution for the case?

    Please, note that in public forums you can attach only images. If you would like, you could open a support ticket where you can attach archive files.

    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top