Hi Guys,
Our application works with a document storage and we use RadRichTextBox to allow users edit and view the documents. Unfortunately, many documents cannot be opened due to the following exception we get:
Unable to cast object of type 'Telerik.Windows.Documents.Model.FieldRangeStart' to type 'Telerik.Windows.Documents.Model.AnnotationRangeEnd
As result we receive complains from our users. Could you please facilitate with solving it?
I have attached a simple test application with the problematic document as well the stacktrace.
Best regards,
Yaroslav
Hi support,
We have a problem when we copy a text from MS word to RitchTextBox.
If the text copied uses an style that the namecontains tilde, then style name on the ritchtextbox is broken with strange characters.
All works well with this strange characters, but if you export to html and then import to ritchtextbox, the style is lost ...
This is a big problem because in spanish, many styles have tildes. When our user copy content from word they have problem with html format export / import.
I Attach a MS Word docx with a style with tildes:
Steps to reproduce it:
1- Open MS Word attached.
2- Copy the content.
3- Open a ritchTextBox Editor
4- Paste the content.
5- Export to html
6- Import the html.
You can see now, that the style are lost, and the name of the style contains strange characters.
Similar issue its happen when open a Word Docx with styles with tildes from ritchTextBox, not include strange characters but the style is lost.
Thanks for you support,
This can be reproduced with the provided .docx. In Word the image floats in the empty space below the text but the RichTextBox has it inline and overlapping text.
Removing the rectangle from around the image in the source document has no affect.
To reproduce:
This works fine when the list is selected with the mouse.
After you have inserted a new row from the context menu of the RadRichTextBox, it becomes selected and then if you want to add a new row from the context menu again, the option is disabled. You should be able to add a new row, so the insert command must be enabled.
When you click for second time the caret locates in the correct position. I.e. there are needed 2 clicks before first line of paragraph which starts with bookmark to set the correct caret position. It also cause the problem of incorrect selection which will select the previous paragraph. This is because bookmarks essentially don't have position before them.
Styles from RTF are incorectly copied to RRTB.
We've run into the following problem with the RadDocumentEditor: 1. Turn on bold 2. Type some characters. 3. Turn off bold. 4. Insert some text using the Insert method in Telerik.Windows.Documents.Model.RadDocumentEditor. The inserted text is bold; it should have no formatting.
When HTML document which contains brackets and is set to RTL is imported, the closing brackets are converted to opening. Workaround: Set RadRichTextBox's TextRenderingMode="TextBlockWithPropertyCaching"
We need to support uneditable areas in the document flow. The closes analog in HTML is <div editableContent=false>...</div>.
MS-Word allows a user to toggle the markup and edit the document as final when track changes are enabled. This feature request is allowing something similar in RadRichTextBox.
When floating images are placed in a header or footer, and are positioned outside of the text editor's area, they are not visualized. MS Word visualizes such images as slightly grayed out (similar to watermarks) in normal mode, and always visualizes them in Header/Footer edit mode. This item is merged with another one concerning the same issue. Please, follow the item at https://feedback.telerik.com/Project/143/Feedback/Details/174624 .
Add support for Widow/Orphan control property of Paragraph. In Open XML specification, this is named "widowControl (Allow First/Last Line to Display on a Separate Page)". The problem is that as this property is not supported, RadRichTextBox acts as it's 'false' and also doesn't export it, but the default value is actually 'true', which causes layout differences between RadRichTextBox and MS Word.
I am constructing a RadDocument in code. The document is protected, but contains several permission ranges where editing is allowed. The sections where editing is allowed contain some custom readonly ranges to further restrict editing. When I assign the RadDocument to the Document property on a RadRichTextBox, I get the exception and stack trace below in the RadDocument.IsInNonEditableRange function. I am using UI for WPF version 2014.1.331.40. The exception and stack trace are: System.InvalidOperationException: Sequence contains more than one element at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source) at Telerik.Windows.Documents.Model.RadDocument.IsInNonEditableRange(Inline inline) at Telerik.Windows.Documents.Model.PermissionChecker.CanExecuteRespectingWrappingReadOnlyRanges(RadDocument document, Boolean respectReadOnlyRanges, DocumentSelection selection, DocumentPosition position) at Telerik.Windows.Documents.Model.PermissionChecker.CanExecuteRespectingRanges(RadDocument document, CanExecuteBehaviorInProtectedDocument canExecuteBehaviorInProtectedDocument, Boolean respectReadOnlyRanges, Boolean respectNonDeletableRanges, Boolean forDeleteOperation, DocumentSelection selection, DocumentPosition position) at Telerik.Windows.Documents.Model.PermissionChecker.CanExecuteRespectingRanges(RadDocument document, CanExecuteBehaviorInProtectedDocument canExecuteBehaviorInProtectedDocument, Boolean respectReadOnlyRanges, Boolean respectNonDeletableRanges, Boolean forDeleteOperation) at Telerik.Windows.Documents.RichTextBoxCommands.RichTextBoxCommandBase.CanExecuteRespectingRanges() at Telerik.Windows.Documents.RichTextBoxCommands.RichTextBoxCommandBase..ctor(RadRichTextBox editor) at Telerik.Windows.Documents.RichTextBoxCommands.SelectionEnabledCommand..ctor(RadRichTextBox editor) at Telerik.Windows.Documents.RichTextBoxCommands.CutCommand..ctor(RadRichTextBox editor) at Telerik.Windows.Documents.RichTextBoxCommands.RichTextBoxCommands.get_CutCommand() at Telerik.Windows.Documents.RichTextBoxCommands.RichTextBoxCommands.InitializeApplicationCommandsMapping() at Telerik.Windows.Documents.RichTextBoxCommands.RichTextBoxCommands.get_ApplicationCommandsMapping() at Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.OnOwnerChanged() at Telerik.Windows.Documents.UI.DocumentPresenterBase.set_Owner(RadRichTextBox value) at Telerik.Windows.Controls.RadRichTextBox.InitActiveEditorPresenter(Boolean clearTextRelatedObjectPools) at Telerik.Windows.Controls.RadRichTextBox.OnApplyTemplate() 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, Boolean& hasDesiredSizeUChanged) 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.Border.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.DockPanel.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.Border.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.DockPanel.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.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.RenderMessageHandler(Object resizedCompositionTarget) 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 issue is reproduced with Marathi IME. Type some letters, press and release shift, then press space. The result is that the current IME text is duplicated.
The spellchecker does not recognize words with non-breaking spaces between them as separate. A workaround when pasting text into the RadRichTextBox is to subscribe to the CommandExecuting event of the control, get the paste text from the clipboard and replace all non-brekaing spaces with spaces. private void editor_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is PasteCommand) { var pasteText = Clipboard.GetDataObject().GetData("HTML Format") as string; if (pasteText != null) { pasteText= pasteText.Replace(" ", " ").Replace(' ',' '); var originalDataObject = Clipboard.GetDataObject(); DataObject dataObject = new DataObject(); foreach (string format in originalDataObject.GetFormats()) { dataObject.SetData(format, originalDataObject.GetData(format)); } dataObject.SetData("HTML Format", pasteText); Clipboard.SetDataObject(dataObject); } } }
Using the microsoft word,In docx document,inserting a shape,and add the text context to the shape,then save.
when radrichtextbox open the file,the program crashed.