This field retrieves a character through a code value specified in the field-argument. Such documents are common and are created when symbols (e.g. with font Windings through Insert -> Symbol dialog) are inserted in RTF documents in MS Word.
The attached video shows how you can reproduce this.
To reproduce: Please refer to the attached sample application and video demonstrating the experience issue. Workaround: Set RadRichTextEditor to null in Form`s Dispose method: Protected Overrides Sub Dispose(ByVal disposing As Boolean) Me.RadRichTextEditor1 = Nothing Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub
Workaround: use a custom RichTextEditorRibbonBar Public Class CustomRichTextEditorRibbonBar Inherits RichTextEditorRibbonBar Dim headerText As String Protected Overrides Function GetInsertTableItems() As RadItemCollection Dim collection As RadItemCollection = MyBase.GetInsertTableItems() Dim headerItem As RadMenuInsertTableItem = TryCast(collection(0), RadMenuInsertTableItem) headerText = "My Header Text" Dim fi As FieldInfo = GetType(RadMenuInsertTableItem).GetField("header", BindingFlags.NonPublic Or BindingFlags.Instance) Dim header As LightVisualElement = fi.GetValue(headerItem) header.Text = headerText AddHandler header.TextChanged, AddressOf header_TextChanged Return collection End Function Private Sub header_TextChanged(sender As Object, e As EventArgs) Dim lve As LightVisualElement = TryCast(sender, LightVisualElement) If lve.Text = "Insert Table" Then lve.Text = headerText End If End Sub End Class
Please refer to the attached screenshot. It is not possible to localize the marked label. Workaround: Sub New() InitializeComponent() Me.RadRichTextEditor1.RichTextBoxElement.InsertHyperlinkDialog = New CustomInsertHyperlinkDialog() End Sub Public Class CustomInsertHyperlinkDialog Inherits InsertHyperlinkDialog Protected Overrides Sub OnLoad(e As EventArgs) MyBase.OnLoad(e) Me.Controls("radLabel4").Text = "My address" End Sub End Class
Merge all assemblies exept Telerik.WinControls.UI.Design.dll. Use the merged assembly in an application with RichTextEditorRibbonBar. The icons are missing.
When the specified length of the stream is larger than the actual one, Adobe throws errors and removes the image. Workaround: Set the format provider settings: PdfFormatProvider provider = new PdfFormatProvider(); PdfExportSettings exportSettings = new PdfExportSettings(); exportSettings.ContentsDeflaterCompressionLevel = 9; exportSettings.ImagesDeflaterCompressionLevel = 9; provider.ExportSettings = exportSettings;
To reproduce: private void radButton1_Click(object sender, EventArgs e) { var document = new RadDocument(); var section = new Section(); document.Sections.Add(section); var paragraph = new Paragraph(); section.Blocks.Add(paragraph); var span = new Span("BOLD"); span.FontWeight = FontWeights.Bold; paragraph.Inlines.Add(span); span = new Span(" REGULAR"); paragraph.Inlines.Add(span); editor.Document = document; var pdfExporter = new PdfFormatProvider(); var path = Path.GetTempFileName() + ".pdf"; using (var file = File.Create(path)) { pdfExporter.Export(document, file); file.Flush(); file.Close(); } Process.Start(path); } Workaround: export .docx file and use the RadWordsProcessing library to import the .doc file and export it to pdf: private void radButton1_Click(object sender, EventArgs e) { var document = new RadDocument(); var section = new Section(); document.Sections.Add(section); var paragraph = new Paragraph(); section.Blocks.Add(paragraph); var span = new Span("BOLD"); span.FontWeight = FontWeights.Bold; paragraph.Inlines.Add(span); span = new Span(" REGULAR"); paragraph.Inlines.Add(span); editor.Document = document; var wordExporter = new Telerik.WinForms.Documents.FormatProviders.OpenXml.Docx.DocxFormatProvider(); var wordPath = Path.GetTempFileName() + ".doc"; using (var file = File.Create(wordPath)) { wordExporter.Export(document, file); file.Flush(); file.Close(); } Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); using (Stream input = File.OpenRead(wordPath)) { Telerik.Windows.Documents.Flow.Model.RadFlowDocument doc = provider.Import(input); Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider(); string filePath = @"..\..\" + DateTime.Now.ToLongTimeString().Replace(":", "-"); using (var output = File.Create(filePath)) { pdfProvider.Export(doc, output); } Process.Start(filePath); } }
To reproduce: 1 Please change the font via selection list first. 2 Set text cursor to font input field and select the whole text (if not already done). 3 Press backspace or delete key. 4 An error message appears. Workaround: protected override void DropDownListFont_SelectedIndexChanged(object sender, PositionChangedEventArgs e) { var ddl = sender as RadDropDownListElement; if (ddl.SelectedItem != null) { base.DropDownListFont_SelectedIndexChanged(sender, e); } }
To reproduce: - Open a document that contains symbols with the 2015 Q3 SP1 version. - Export the document using the docx format. - Open it again. Workaround: private void radRichTextEditor1_DocumentChanged(object sender, EventArgs e) { this.SelectAllMatches("ï‚°"); this.radRichTextEditor1.ChangeFontFamily(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Symbol")); this.SelectAllMatches("ï‚£"); this.radRichTextEditor1.ChangeFontFamily(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Symbol")); } private void SelectAllMatches(string toSearch) { this.radRichTextEditor1.Document.Selection.Clear(); DocumentTextSearch search = new DocumentTextSearch(this.radRichTextEditor1.Document); foreach (var textRange in search.FindAll(toSearch)) { this.radRichTextEditor1.Document.Selection.AddSelectionStart(textRange.StartPosition); this.radRichTextEditor1.Document.Selection.AddSelectionEnd(textRange.EndPosition); } }
To reproduce: - Export document with an inline UI elements to HTML. - Import the document. Workaround: - Manually export the UI elements information and then create new UI elements when the document is imported: void ImportSettings_InlineUIContainerImporting(object sender, InlineUIContainerImportingEventArgs e) { PropertyInfo property = typeof(InlineUIContainerImportingEventArgs).GetProperty("Handled"); property.GetSetMethod(true).Invoke(e, new object[] { true }); ObjectHandle handle = Activator.CreateInstance("Telerik.WinControls.UI", e.CommentContent); Object control = handle.Unwrap(); InlineUIContainer container = new InlineUIContainer(); RadElementUIContainer radContainer = new RadElementUIContainer(control as RadElement); container.UiElement = radContainer; container.Height = 30; container.Width = 300; e.TargetParagraph.Inlines.Add(container); } //export private void btnWrite_Click(object sender, EventArgs e) { HtmlFormatProvider provider = new HtmlFormatProvider(); provider.ExportSettings.InlineUIContainerExporting += ExportSettings_InlineUIContainerExporting; File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\TelerikUITest.html", provider.Export(this.radRichTextEditor1.Document)); } void ExportSettings_InlineUIContainerExporting(object sender, Telerik.WinForms.Documents.FormatProviders.Html.InlineUIContainerExportingEventArgs e) { string control = ((RadElementUIContainer)e.InlineUIContainer.UiElement).Element.ToString(); e.CommentContent = control; }
To reproduce: - Add some text and change its forecolor. - Add more text and change its highlighting - Save as rtf and open it in WordPad.
Workaround: use different instances of RibbonUI
Workaround: private void CopyButton_Click(object sender, EventArgs e) { this.radRichTextEditor1.Document.EnsureDocumentMeasuredAndArranged(); if (this.radRichTextEditor1.Document.Selection.IsEmpty) { return; } string selectedText = this.radRichTextEditor1.Document.Selection.GetSelectedText(); DocumentFragment fragmentToCopy = this.radRichTextEditor1.Document.Selection.CopySelectedDocumentElements(true); DataObject dataObject = new DataObject(); if (selectedText != "") { ClipboardEx.SetText(null, selectedText, dataObject); } ClipboardEx.SetDocument(fragmentToCopy, dataObject); ClipboardEx.SetDataObject(dataObject); }