When highlighting text inside the richtexteditor control I receive a null reference exception.
To reproduce: - Create a document that contains a numbered list (set different font size for the list). - Export it to html and import it back. - You will notice that the numbers are larger the the other text.
Description and workaround: It appears that Outlook produces different RTF contents when using its different Copy commands. In some cases the RTF string produced by Outlook contains empty spans which is not a valid element in our implementation. To handle that case, you can subscribe to the CommandExecuting event to capture the Paste command before it was executed, strip the empty spans, and then modify the clipboard contents with a valid RTF string. Additionally, when you try to delete the text of pasted hyperlinks using backspace, an exception will be thrown at some point (for example, after pasting the link \\server\folder1\somefile.txt and deleting the dot). The following code snippet demonstrates how to handle deleting pasted links: Private Sub radRichTextEditor1_CommandExecuting(sender As Object, e As CommandExecutingEventArgs) Handles radRichTextEditor1.CommandExecuting If TypeOf e.Command Is DeleteCommand Me.RadRichTextEditor1.RichTextBoxElement.InvalidateMeasure(true) Me.RadRichTextEditor1.RichTextBoxElement.UpdateLayout() End If End Sub The following code snippet demonstrates how to handle removing empty spans: Private Sub radRichTextEditor1_CommandExecuting(sender As Object, e As CommandExecutingEventArgs) Handles radRichTextEditor1.CommandExecuting If Not (TypeOf e.Command Is PasteCommand) Then Return End If Dim docString As String = Nothing Dim docObj As Object = Clipboard.GetData("Rich Text Format") If docObj IsNot Nothing AndAlso docObj.[GetType]() = GetType(String) Then docString = DirectCast(docObj, String) End If Dim document As RadDocument = Nothing Using stream As New MemoryStream() Dim writer As New StreamWriter(stream) writer.Write(docString) writer.Flush() stream.Seek(0, SeekOrigin.Begin) Try document = New RtfFormatProvider().Import(stream) Catch ex As Exception System.Diagnostics.Debug.WriteLine("Error reading document from clipboard:" & vbLf + ex.ToString()) End Try End Using If document IsNot Nothing Then Dim emptySpans As New List(Of Span)() For Each span As var In document.EnumerateChildrenOfType(Of Span)() If [String].IsNullOrEmpty(span.Text) Then emptySpans.Add(span) End If Next If emptySpans.Count = 0 Then Return End If For Each span As var In emptySpans span.Parent.Children.Remove(span) Next Dim modifiedRtf As String = New RtfFormatProvider().Export(document) Clipboard.SetData("Rich Text Format", modifiedRtf) End If End Sub
Whed the form is resized at some point the text of the items is not visible and there is a lot of free space.
To reproduce: - Create a new winforms project. - Drop a RadRichTextEditor on the form. - Drop a button on the form. - In the button Click event add: radRichTextEditor1.ShowSpellCheckingDialog(); - Run the project. - Click the button - a message is displayed "The spelling check is complete". - Type some text with a spelling error in the rich text editor. - Click the button again - a System.InvalidOperationException exception occurs. Workaround: radRichTextEditor1.RichTextBoxElement.SpellCheckingDialog = new SpellCheckingDialog();
To reproduce: - Export rtf file with a bullet list - use the old RadRichTextBox. - Import the file in the RadRichTextEditor in WebLayout mode. - The entire list is shifted to the left and the bullets are not visible. The issue is present because the old RadRichTextBox was exporting bullets with negative indent and the WebLayout mode always starts from 0.
If the main document part of a DOCX document is with name different than "document.xml", for example "document2.xml", the content of the document is not imported. Such documents are created by OpenXML SDK, if for example this tutorial is followed: How to: Convert a word processing document from the DOCM to the DOCX file format - http://tpdogfood.telerik.com/msdn.microsoft.com/en-us/library/office/gg188063(v=office.15).aspx.
If you insert an InlineUIContainer with a RadTextBoxElement, you should be able to export its content when exporting the whole document.
add property that allows the width of the caret to be changed.
html tables cannot be properly pasted in word when imported table size is defined in "pt". consider adding the a table like this as well: <html> <body> <table border="1"> <tbody> <tr> <td>A</td> <td>B</td> <td>C</td> </tr> <tr> <td>A1</td> <td>B1</td> <td>C1</td> </tr> </tbody> </table> </body> </html>
Drop a RadRichTextEditor and a WinForms button on a form. Set the text of the button to "&Activate" and show a message box in the button click handler. Run the program, and type some text - the button is activated whenever you try to type the letter "a" in the editor. Workarround: Inherit RadRichTextEditor and override IsInputChar method protected override bool IsInputChar(char charCode) { return true; }
Steps to reproduce: 1. Create a new project 2. Drop a RadRichTextEditor on the form 3. Run the project 4. Type some text 5. Press Ctrl+R to align the text right 6. Press Ctrl+L to align the text left. The text is left aligned, but the right aligned text is not cleared till the control is invalidated.
To reproduce: - Create new application with a richtextbox in it. - Build it and merge the assemblies. - Start the application type some text then select a part of it and try to do something else. - Note that this occur only the first time when the application is started.
When the border thickness is increased the table size should be increased as well - like in Microsoft Word.
1) Launch the RadRichTextEditor 2) enter some text (at least three lines) 3) select the whole content and apply bullets/ numbers 5) Since the whole content is already selected, open the font color dialog box and try to apply a color (say red color) 6) Notice for the last item in the list , the selected color is not applied to the bullets/ numbers as shown in the attached figs
1) Launch the RadRichTextEditor 2) Create a new file 3) go to insert tab and hit "Header" icon (Header & Footer section) 4) Notice the caret blinks on the top left corner of the document 5) Enter some text for ex: zzzz and notice text entered doesn't show up 5) At this point when you double click outside the header section the whole header and footer section is lost 6) Now double click on the header section again even though the header section is not visible. Still the entered text is not displayed and notice the cursor blinks at the top left corner of the header section 7) Press enter key, now the entered text is displayed.
Run the RadRichTextEditor Right click on any image -> Text Wrapping -> More layout options (as shown in the attached fig MoreLayoutOptions.jpg) Observe that the more layout options doesn't show up most of the times.