Steps to reproduce:
1. Set ScaleFactor to 1.5
2. Run the form on 125% monitor scaling.
Implement support for content controls (a.k.a. Structured document tags), which will allow inserting editing controls in the document: - Rich Text - Plain Text - Check Box - Combo Box - Drop-down list - Date picker
This functionality will decrease the size of the exported document.
Copy some content and paste it in the editor. The PasteOptions dialog remains opened and if the user clicks the PrintPreview button an error occurs:
Stack trace:
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.RichTextEditor.UI.PasteOptionsPopup.OnRichTextBoxLayoutUpdated(Object sender, EventArgs e)
at Telerik.WinControls.Layouts.ContextLayoutManager.fireLayoutUpdateEvent()
at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
at Telerik.WinForms.Documents.UI.DocumentPrintPresenter.Telerik.WinForms.RichTextEditor.IDocumentEditorPresenter.UpdateLayout()
at Telerik.WinForms.RichTextEditor.RadRichTextBox.<>c__DisplayClass653_0.<UpdateEditorLayout>b__0()
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:
this.radRichTextEditor1.Text = null;
"http://" prefix is automatically added by the Insert Hyperlink Dialog when the provided URI is to local path or mapped drive, e.g. "Z:\temp". Workaround 1: Set HyperlinkPattern to something that matches file paths, e.g.: (this.radRichTextEditor1.RichTextBoxElement.InsertHyperlinkDialog as InsertHyperlinkDialog).HyperlinkPattern = ".*"; Workaround 2: Insert such paths with the "file://" prefix.
The ChangeFontStyle method does not work when setting Underline:
radRichTextEditor1.ChangeFontStyle( FontStyle.Underline);
Workaround:
radRichTextEditor1.ToggleUnderline();
RadRichTextEditor: The paste options popup stays visible when the control is hidden
Workaround:
((MiniToolBarBase)this.radRichTextEditor1.RichTextBoxElement.PasteOptionsPopup).Hide();
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.
The paragraphs in the table are inheriting the negative indent from the previous paragraph.
Workaround: Manually remove the negative indent from the table paragraphs after the table is added.
The workaround in code:
private void RadRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e)
{
if (e.Command is InsertTableCommand)
{
var table = radRichTextEditor1.Document.CaretPosition.GetCurrentTable();
table.TableIndent = 0;
if (table != null)
{
foreach (var row in table.Rows)
{
foreach (var cell in row.Cells)
{
foreach (var block in cell.Blocks)
{
var paragrpah = block as Paragraph;
if (paragrpah != null && paragrpah.LeftIndent < 0)
{
paragrpah.LeftIndent = 0;
paragrpah.HangingIndent = 0;
}
}
}
}
}
radRichTextEditor1.RichTextBoxElement.Document.UpdateLayout();
}
}
To reproduce: please refer to the attached sample project. You will notice that the exported HTML content from the left RadRichTextEditor is imported to the right and the bullets are not the same.