Unplanned
Last Updated: 16 Apr 2021 06:30 by ADMIN
Oksana
Created on: 16 Apr 2021 06:30
Category: RichTextEditor
Type: Feature Request
2
RichTextEditor: Image size is reset after leaving the header

To reproduce: 

public RadForm1()
{
    InitializeComponent();
    radRichTextEditor1.CommandExecuted += RadRichTextEditor1_CommandExecuted; 
    radRichTextEditor1.ActiveDocumentEditorChanged += RadRichTextEditor1_ActiveDocumentEditorChanged;
}

private void RadRichTextEditor1_ActiveDocumentEditorChanged(object sender, Telerik.WinForms.Documents.UI.ActiveDocumentEditorChangedEventArgs e)
{
    e.OldActiveEditor.CommandExecuted -= RadRichTextEditor1_CommandExecuted;
    e.NewActiveEditor.CommandExecuted += RadRichTextEditor1_CommandExecuted;        
}

 
private void RadRichTextEditor1_CommandExecuted(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutedEventArgs e)
{
    if (e.Command is InsertPictureCommand)
    {

        var imageInline = this.radRichTextEditor1.DocumentEditor.Document.CaretPosition.GetPreviousInline() as ImageInline;
        if (imageInline != null)
        {
            imageInline.Size = new Telerik.WinControls.RichTextEditor.UI.Size(50, 50);
        }
    }
}
0 comments