To reproduce:
- Add RichTextEditorRuler and RichTextEditor to a form.
- Add some tab stops in the ruler and press the tab key.
Workaround:
void radRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is IncrementParagraphLeftIndentCommand)
{
e.Cancel = true;
TabForwardCommand tabForward = new TabForwardCommand(this.radRichTextEditor1.RichTextBoxElement);
tabForward.Execute();
}
}
To reproduce:
- Add several RadRichTextEditors to a form.
- Change the icon of the FontPropertiesDialog.
- Close the form and force the garbage collector.
Workaround:
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
foreach (var item in this.Controls)
{
var rte = item as RadRichTextEditor;
if (rte != null)
{
((FontPropertiesDialog)rte.RichTextBoxElement.FontPropertiesDialog).Dispose();
}
}
}
To reproduce: - Add some text so the scrollbars appear. - Scroll up and down with the mouse wheel. - When you scroll to the bottom you will notice that there is extra space after the document end. Workaround: http://www.telerik.com/forums/backspace-key-does-not-properly-invalidate-editor#sP5qkJX4b0S8jwZ3MUGTmQ
To reproduce:
- Add RadRichtextEditor to a form and assosite it with RichTextEditorRibbonBar
- Start the application
- You will notice that the font is Agency FB.
- If you click in the editor the font will change.
Workaround:
void Form1_Shown(object sender, EventArgs e)
{
radRichTextEditor1.Focus();
ribbonBar1.GetType().GetMethod("HandleFontStylePropertiesOnCurrentEditingStyleChanged", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).Invoke(ribbonBar1,null);
}
Workaround: load an empty docx document in the RadRichTextEditor and use it as a template
public RadDocument ImportDocx()
{
RadDocument document = null;
IDocumentFormatProvider provider = new DocxFormatProvider();
OpenFileDialog openDialog = new OpenFileDialog();
openDialog.Filter = "Documents|*.docx";
openDialog.Multiselect = false;
DialogResult dialogResult = openDialog.ShowDialog();
if (dialogResult == System.Windows.Forms.DialogResult.OK)
{
using (Stream stream = openDialog.OpenFile())
{
document = provider.Import(stream);
}
}
return document;
}
To reproduce:
- Add two tabs in a PageView
- Add RadRichTextEditor in the second tab
- Select some text to show the mini toolbar
- Select the first page.
Workaround
void radPageView1_SelectedPageChanged(object sender, EventArgs e)
{
if (radPageViewPage2.IsContentVisible == false)
{
radRichTextEditor1.RichTextBoxElement.SelectionMiniToolBar.Hide();
}
}
How to reproduce:
public partial class Form1 : Form
{
RadRichTextBox tb1;
RadRichTextBox tb2;
private bool shouldFocus = false;
public Form1()
{
InitializeComponent();
tb1 = new RadRichTextBox();
this.Controls.Add(tb1);
tb2 = new RadRichTextBox();
tb2.Location = new Point(200, 0);
this.Controls.Add(tb2);
this.Load += Form1_Load;
}
private void Form1_Load(object sender, EventArgs e)
{
StyleDefinition style = new StyleDefinition();
tb1.IsReadOnly = true;
tb1.Document.Insert("text 1", style);
tb2.Document.Insert("text 2", style);
tb2.IsReadOnly = true;
}
private void radButton1_Click(object sender, EventArgs e)
{
tb1.IsReadOnly = false;
tb2.IsReadOnly = false;
tb1.Focus();
}
}
Workaround:
public partial class Form1 : Form
{
RadRichTextBox tb1;
RadRichTextBox tb2;
private bool shouldFocus = false;
public Form1()
{
InitializeComponent();
tb1 = new RadRichTextBox();
tb1.GotFocus += tb1_GotFocus;
tb1.LostFocus += tb1_LostFocus;
this.Controls.Add(tb1);
tb2 = new RadRichTextBox();
tb2.Location = new Point(200, 0);
tb2.GotFocus += tb2_GotFocus;
tb2.LostFocus += tb2_LostFocus;
this.Controls.Add(tb2);
this.Load += Form1_Load;
}
private void tb2_LostFocus(object sender, EventArgs e)
{
shouldFocus = false;
tb2.IsReadOnly = true;
}
private void tb2_GotFocus(object sender, EventArgs e)
{
if (shouldFocus)
{
tb2.IsReadOnly = false;
}
}
private void tb1_LostFocus(object sender, EventArgs e)
{
tb1.IsReadOnly = true;
}
private void tb1_GotFocus(object sender, EventArgs e)
{
if (shouldFocus)
{
tb1.IsReadOnly = false;
}
}
private void Form1_Load(object sender, EventArgs e)
{
StyleDefinition style = new StyleDefinition();
tb1.IsReadOnly = true;
tb1.Document.Insert("text 1", style);
tb2.Document.Insert("text 2", style);
tb2.IsReadOnly = true;
}
private void radButton1_Click(object sender, EventArgs e)
{
if (shouldFocus)
{
tb2.Focus();
}
else
{
shouldFocus = true;
tb1.Focus();
}
}
}
When the RadRichTExtEditor.Document is rapidly changed not all memory is released Workaround: Point loc = radRichTextEditor1.Location; Size size = radRichTextEditor1.Size; radRichTextEditor1.Dispose(); radRichTextEditor1 = new RadRichTextEditor(); radRichTextEditor1.Location = loc; radRichTextEditor1.Size = size; this.Controls.Add(radRichTextEditor1);
To reproduce: - Add comment and try to select the text with the mouse. Workaround: use keyboard to select the desired text
Workaround: explicitly set the font size of the spans in the heading paragraphs
foreach (Section section in this.radRichTextEditor1.Document.Sections)
{
foreach (Block block in section.Blocks)
{
Paragraph p = block as Paragraph;
if (p != null && p.StyleName == "Heading1")
{
foreach (var item in p.Inlines)
{
Span s = item as Span;
if (s!= null)
{
s.FontSize = p.FontSize;
}
}
}
}
}
The LocalizeStrings method of the FloatingBlockPropertiesDialog refers to the "Documents_FindReplaceDialog_ReplaceWith" string. This should be "Documents_FloatingBlockPropertiesDialog_TextWrapping"
Workaround:
public Form1()
{
InitializeComponent();
FieldInfo fi = this.radRichTextEditor1.RichTextBoxElement.FloatingBlockPropertiesDialog.GetType().GetField("radPageViewPage2", BindingFlags.NonPublic | BindingFlags.Instance);
RadPageViewPage textWrappingPage = (RadPageViewPage)fi.GetValue(this.radRichTextEditor1.RichTextBoxElement.FloatingBlockPropertiesDialog);
textWrappingPage.Text = "TextWrapping";
}
To reproduce:
Add image like this:
void button_Click1(object sender, EventArgs e)
{
Section section = new Section();
Paragraph paragraph = new Paragraph();
ImageInline image;
Telerik.WinControls.RichTextEditor.UI.Size size = new Telerik.WinControls.RichTextEditor.UI.Size(236, 50);
using (MemoryStream ms = new MemoryStream())
{
System.Drawing.Image.FromFile(@"C:\img\delete.png").Save(ms, System.Drawing.Imaging.ImageFormat.Png);
image = new ImageInline(ms, size, "png");
}
paragraph.Inlines.Add(image);
section.Children.Add(paragraph);
this.radRichTextEditor1.Document.Sections.Add(section);
}
Workaround:
Manually update the layout:
this.radRichTextEditor1.UpdateEditorLayout();
To reproduce:
Seth the default font like this:
radRichTextEditor1.Document.StyleRepository[RadDocumentDefaultStyles.NormalStyleName].SpanProperties.FontFamily = new Telerik.WinControls.RichTextEditor.UI.FontFamily("Segoe Script");
radRichTextEditor1.RichTextBoxElement.ChangeFontFamily(new Telerik.WinControls.RichTextEditor.UI.FontFamily("Segoe Script"));
radRichTextEditor1.RichTextBoxElement.ChangeFontSize(Unit.PointToDip(12));
radRichTextEditor1.RichTextBoxElement.ChangeFontStyle(Telerik.WinControls.RichTextEditor.UI.FontStyles.Italic);
radRichTextEditor1.RichTextBoxElement.ChangeFontWeight(Telerik.WinControls.RichTextEditor.UI.FontWeights.Bold);
Start the application and insert header footer and endnotes.
To reproduce: - Create a document in Word and add image watermark to it. - Open the document in RadRichtextEditor
To reproduce:
- Add RichTextEditorRibbonBar to a form and open it upon button click several times.
- You will notice that the memory is constantly increasing.
Workaround:
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
FieldInfo f1 = this.richTextEditorRibbonBar1.GetType().GetField("tabTableStyle", BindingFlags.NonPublic| BindingFlags.Instance);
RichTextEditorRibbonTab tab1 = f1.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab;
tab1.Dispose();
FieldInfo f2 = this.richTextEditorRibbonBar1.GetType().GetField("tabTableLayout", BindingFlags.NonPublic | BindingFlags.Instance);
RichTextEditorRibbonTab tab2 = f2.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab;
tab2.Dispose();
FieldInfo f3 = this.richTextEditorRibbonBar1.GetType().GetField("tabHeaderFooter", BindingFlags.NonPublic | BindingFlags.Instance);
RichTextEditorRibbonTab tab3 = f3.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab;
tab3.Dispose();
base.Dispose(disposing);
}
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
Add similar functionality as MS Word.
To reproduce:
- Start the demo application
- Type some text and try to make it bold with the bold button from the ribbon.
Workaround:
void richTextEditorRibbonBar1_MouseDown(object sender, MouseEventArgs e)
{
radRichTextEditor1.RichTextBoxElement.SelectionMiniToolBar.Hide();
}