When you load a HTML file where the image is not loaded properly and you try to export RadRichTextEditor's document to a pdf, an error occurs. Workaround: If the image doesn't exist you can skip loading in the document. Thus, exporting to pod at a later moment won't produce an error. You can use the HtmlImportSettings.LoadImageFromUrl event and handle the image loading: Sub New() ' This call is required by the designer. InitializeComponent() Dim provider As HtmlFormatProvider = New HtmlFormatProvider() Dim htmlImportSettings As HtmlImportSettings = New HtmlImportSettings() AddHandler htmlImportSettings.LoadImageFromUrl, AddressOf LoadImageFromUrl provider.ImportSettings = htmlImportSettings Using inputStream As FileStream = File.OpenRead("..\..\Email HTML.html") Me.RadRichTextEditor1.Document = provider.Import(inputStream) End Using End Sub Private Sub LoadImageFromUrl(sender As Object, e As LoadImageEventArgs) e.Handled = True End Sub
To reproduce: - Drop RadRichTextEditor to a form. - Set the theme to FluentDark. Workaround: radRichTextEditor1.ChangeTextForeColor(Color.White); or public void SetBackColor() { this.radRichTextEditor1.RichTextBoxElement.BackColor = Color.White; Theme theme = ThemeRepository.FindTheme("TelerikMetroBlue"); foreach (var styleGroup in theme.StyleGroups) { foreach (PropertySettingGroup settingGroup in styleGroup.PropertySettingGroups) { if (settingGroup.Selector.Value == "Telerik.WinControls.RichTextEditor.UI.Page") { foreach (PropertySetting property in settingGroup.PropertySettings) { if (property.Name == "BackColor") { property.Value = System.Drawing.Color.White; } } } if (settingGroup.Selector.Value == "Telerik.WinControls.RichTextEditor.UI.HeaderFooterContainer") { foreach (PropertySetting property in settingGroup.PropertySettings) { if (property.Name == "OverlayColor") { property.Value = System.Drawing.Color.White; } } } } } }
To reproduce: add a RadRichTextEditor with ribbon UI. Set the RichTextEditorRibbonBar's theme to Fluent at design time. When you run the application you will notice that the theme is not properly applied to the backstage view. Workaround: ThemeResolutionService.ApplicationThemeName = "Fluent";
Workaround: public TextEditorRadForm() { InitializeComponent(); ((RadForm)this.radRichTextEditor1.RichTextBoxElement.InsertCaptionDialog).Controls["radRichTextEditorLabel"].Text = ""; }
************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at Telerik.WinForms.Documents.UI.UIProviders.WatermarkUIProvider.Arrange(UILayerUpdateContext uILayerUpdateContext) at Telerik.WinForms.Documents.UI.Layers.ProviderUILayerBase.ArrangeChildren() at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.ArrnageUILayers() at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.MeasureOverride(SizeF availableSize) at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize) at Telerik.WinControls.RadElement.Measure(SizeF availableSize) at Telerik.WinControls.RadElement.MeasureChildren(SizeF availableSize) at Telerik.WinControls.RichTextEditor.UI.FrameworkElement.MeasureOverride(SizeF availableSize) at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize) at Telerik.WinControls.RadElement.Measure(SizeF availableSize) at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout() at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.Telerik.WinForms.RichTextEditor.IDocumentEditorPresenter.UpdateLayout() at Telerik.WinForms.RichTextEditor.RadRichTextBox.<>c__DisplayClass3.<UpdateEditorLayout>b__2() at Telerik.WinForms.RichTextEditor.RadRichTextBox.UpdateEditorLayout(Boolean focusCarret, Boolean updateCaretSize, Boolean async) at Telerik.WinForms.RichTextEditor.RadRichTextBox.set_ActiveEditorPresenter(IDocumentEditorPresenter value) at Telerik.WinForms.RichTextEditor.RadRichTextBox.Telerik.WinControls.UI.IPrintable.BeginPrint(RadPrintDocument sender, PrintEventArgs args) at Telerik.WinControls.UI.RadPrintDocument.OnBeginPrint(PrintEventArgs e) at System.Drawing.Printing.PrintDocument._OnBeginPrint(PrintEventArgs e) at System.Drawing.Printing.PrintController.Print(PrintDocument document) at System.Drawing.Printing.PrintDocument.Print() at System.Windows.Forms.PrintPreviewControl.ComputePreview() at System.Windows.Forms.PrintPreviewControl.CalculatePageInfo() at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks() To reproduce: please refer to the attached gi file demonstrating how to replicate the problem with the Demo application. Workaround: private void radRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is ChangeIntegratedWatermarkTypeCommand && this.radRichTextEditor1.LayoutMode!= Telerik.WinForms.Documents.Model.DocumentLayoutMode.Paged) { e.Cancel = true; } }
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; }
If you press keys as the following order with English keyboard in Korean IME, you can get Korean letters - 가나다라.
'rkskekfk'
rk => 가
sk => 나
ek => 다
fk => 라
When I use Korean letters, second or third letter disappeared - 가다라.
When importing HTML files if the font from the style contains serif element the font does not get interpreted correctly. For example "font-family: 'Times New Roman','serif';" - this will not work, but this font-family: 'Times New Roman';" will work.
To reproduce: run the project and maximize the form. When you enter some text you will notice that the text is cut off. Workaround: use paged layout.
To reproduce: please refer to the attached sample project and follow the steps in the gif file. Workaround: private void radRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is ChangeIntegratedWatermarkTypeCommand && this.radRichTextEditor1.LayoutMode!= Telerik.WinForms.Documents.Model.DocumentLayoutMode.Paged) { e.Cancel = true; } }
To reproduce: var d = new RadDocument(); var s = d.GetStatisticsInfo(); Workaround: var d = new RadDocument(); if (d.Sections.Count > 0 && d.Sections.Last.Blocks.Count >0) { var s = d.GetStatisticsInfo(); }
In certain fonts the caret is drawn on part of the last inputted character
When the document is protected, CommandExecuting is not raised when the user double clicks the header or footer area.
I added this line just before Application.Run(new MainForm()); in Word-inspired project:
RichTextBoxLocalizationProvider.CurrentProvider = RichTextBoxLocalizationProvider.FromFile(@
"AllCapsRichTextBoxStrings.xml"
);
I took RichTextBoxStrings.xml from localization page of RichTextEditor. In the xml file I converted all the text between <value> tags to uppercase, and also replaced "OK" (value of "Confirm" data element) with "AYE". I expected all the OK's in all the forms within rich text editor to be replaced, but they all remained as "Ok" (note the lower case "k" here). Well, all except Page Layout > Columns form, which did display AYE, and also References > Insert citation. So, here are the issues that I found:
To create AllCapsRichTextBoxStrings.xml, make a copy of provided resource file, open it in Notepad++ and replace all <value>([^<]*)</value> with <value>\U\1\E</value> using regular expressions, and then replace all &, < and > with &, < and >.
How to reproduce: set the RadRichTextEditor.IsReadOnly property to true, focus the control, use the Ctrl + K shortcut. The InsertHyperlinkDialog will be opened. Workaround: handle the CommandExecuting event public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radRichTextEditor1.IsReadOnly = true; this.radRichTextEditor1.CommandExecuting += RadRichTextEditor1_CommandExecuting; } private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (this.radRichTextEditor1.IsReadOnly && e.Command is ShowInsertHyperlinkDialogCommand) { e.Cancel = true; } } }
Currently, the document won't be imported due to an exception when decoding the base64 string image source. The expected behavior is the document to be imported and the image to be shown as a missing image.
Right-click on header/footer usually does nothing. If we double-click them we enter their edit mode. After we close header and footer and right-click on them we get context menu as if we are still in edit mode. If we scroll out of view of header/footer, and then back in, right-click will again do nothing.
Also, separate but similar bug, in demo document's footer there is a three-column table. It is possible to resize with the mouse all the columns widths, and even the row height. Mouse will change shape, as if in edit mode. It is not necessary to enter and leave edit mode like in previous case, the error is observable from the start. But if we scope out and scope back in the changes are undone, in a way like in previous case.
In R2 2019 RichTextEditor has a new GUI element, a toggle button named Simplified Ribbon. It looks neat, and I like it, but now I have to localize it. There is a link to a strings file on page https://docs.telerik.com/devtools/winforms/controls/richtexteditor/localization , but I can't find the text "simplified ribbon" in that xml file.
My fallback plan is to download the whole Telerik source code, I'm just reminding you here to update the file. And to ask you to update the file together with Telerik update in the future.