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
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
Currently all tables are stuck to the let and there cannot be a text before them.
To reproduce: - Click the AA Styles button to open the Styles dialog. - Scroll down and select the CodeBlock item - The style does not change
Workaround: public class CustomRadRichTextEditor : RadRichTextEditor { /// <summary> /// Gets or sets the width of the caret. /// </summary> [Browsable(false)] [Category(RadDesignCategory.AppearanceCategory)] public new float CaretWidth { get { float caretWidth = base.CaretWidth; if (float.IsNaN(caretWidth)) { return 2; } return caretWidth; } set { base.CaretWidth = value; } } }
how to reproduce: check the attached video
The bullets can have their own alignment. Implement import and export of this setting. In MS Word, this alignment can be set through the Numbering dropdown -> Define New Number Format
How to reproduce: check the attached video
To reproduce: - Add a table where the width is set to 100% - Import the table and the export it: private void radButton_Click(object sender, RoutedEventArgs e) { var provider = new HtmlFormatProvider(); string text = File.ReadAllText(@"..\..\default.html"); rtb1.Document = provider.Import(text); } private void radButton1_Click(object sender, RoutedEventArgs e) { var provider = new HtmlFormatProvider(); provider.ExportSettings.StylesExportMode = StylesExportMode.Inline; string content = provider.Export(rtb1.Document); File.WriteAllText(@"D:\test1.html", content); } Workaround: Leave the export mode intact.
Workaround: Set the next style property for all types except the Paragraph to an empty string foreach (var style in this.radRichTextBox.Document.StyleRepository) { if (style.Type!=Telerik.Windows.Documents.Model.Styles.StyleType.Paragraph && !string.IsNullOrEmpty(style.NextStyleName)) { style.NextStyleName = string.Empty; } }
1. Create a document containing a style with NextStyleName: StyleDefinition myStyle = new StyleDefinition(); myStyle.Type = StyleType.Table; myStyle.DisplayName = "My Style"; myStyle.Name = "myStyle"; myStyle.NextStyleName = RadDocumentDefaultStyles.HyperlinkStyleName; this.radRichTextBox.Document.StyleRepository.Add(myStyle); 2. Add several paragraphs and select some of them (ensure there is one using our custom style). 3. Create a DocumentFragment using the selection's CopySelectedDocumentElements 4. Convert the fragment to RadDocument and try to export it Observed: When exporting to DOCX and XAML, the style is missing. Exporting to RTF causes KeyNotFoundException. Expected: The style should be preserved in the exported document Workaround: After creating the document from the fragment, ensure all needed styles are copied and available.
To reproduce: - Open the demo application. - Go to the Table Styles example. - Open the TableBorders dialog from the context menu and hit reset all.
Workaround: private void RadRichTextEditor1_CommandExecuting(object sender, CommandExecutingEventArgs e) { if (!(e.Command is PasteCommand)) { return; } DocumentFragment res = ClipboardEx.GetDocumentFromClipboard("RadDocumentGUID"); if (res == null) { foreach (ClipboardHandler settings in ClipboardEx.ClipboardHandlers) { res = ClipboardEx.GetDocumentFromClipboard(settings.ClipboardDataFormat, settings.ClipboardStringFilter); } } if (res == null) { e.Cancel = true; System.Drawing.Image bitmapSource = Clipboard.GetImage(); if (bitmapSource == null) { return; } Telerik.WinForms.Documents.Layout.Padding sectionmargin = this.radRichTextEditor1.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection.ActualPageMargin; double originalPixelWidth = bitmapSource.Width; double originalPixelHeight = bitmapSource.Height; if (originalPixelWidth == 0 || originalPixelHeight == 0) { originalPixelWidth = 10; originalPixelHeight = 10; } double width = originalPixelWidth; double height = originalPixelHeight; if (this.radRichTextEditor1.Document.LayoutMode == DocumentLayoutMode.Paged) { Section currentSection = this.radRichTextEditor1.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection; Telerik.WinForms.Documents.Model.SizeF pageSize = (Telerik.WinForms.Documents.Model.SizeF)currentSection.GetType().GetProperty("ActualPageSize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(currentSection); double maxWidth = pageSize.Width - (sectionmargin.Left + sectionmargin.Right); double maxHeight = pageSize.Height - (sectionmargin.Top + sectionmargin.Bottom); width = Math.Min(maxWidth, width); height = Math.Min(maxHeight, height); } double ratio = originalPixelWidth / originalPixelHeight; width = Math.Min(width, height * ratio); height = width / ratio; Telerik.WinControls.RichTextEditor.UI.Size size = new Telerik.WinControls.RichTextEditor.UI.Size(width, height); ImageInline imageInline = new ImageInline(new WriteableBitmap(bitmapSource)); imageInline.Size = size; this.radRichTextEditor1.RichTextBoxElement.ActiveDocumentEditor.InsertInline(imageInline); } }
To reproduce: - Load a right to left document with Hebrew characters. - Export it to PDF - The characters' position is not correct.
Workaround: private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e) { if (e.Command is SaveCommand) { DocumentPosition initial = this.radRichTextEditor1.Document.CaretPosition; DocumentPosition start = new DocumentPosition(initial); DocumentPosition end = new DocumentPosition(initial); var spans = this.radRichTextEditor1.Document.EnumerateChildrenOfType<Span>(); foreach (var span in spans) { if (span.FontStyle != FontStyle.Regular) { continue; } start.MoveToInline(span); end.MoveToEndOfDocumentElement(span); this.radRichTextEditor1.Document.Selection.AddSelectionStart(start); this.radRichTextEditor1.Document.Selection.AddSelectionEnd(end); this.radRichTextEditor1.RichTextBoxElement.Commands.ChangeFontFamilyCommand.Execute("Calibri"); } this.radRichTextEditor1.Document.CaretPosition.MoveToPosition(initial); } }
Please refer to the attached screenshots. A sample .docx file is attached. Just load it in RadRichTextEditor.
Use attached to reproduce.