This is a migrated thread and some comments may be shown as answers.

Ctrl + K still works when IsReadOnly=True

1 Answer 57 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 2
Bruce asked on 30 Aug 2017, 07:35 PM
this.radRichTextEditor.IsReadOnly = true;

still allow you to add hyperlink the document body.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 31 Aug 2017, 01:35 PM
Hi Bruce,

Thank you for writing.

Indeed the observed behavior is an issue and I have logged it in our feedback portal, here: FIX. RadRichTextEditor - the InsertHyperlinkDialog can still be opened using the Ctrl + K key shortcut even when the control has its IsReadOnly property set to true. I have also updated your Telerik points
The item is already in development and a fix will be made available with our  R3 release scheduled for mid-September.

Until the release please handle the CommandExecuting event and cancel it if the control is read-only and the command is ShowInsertHyperlinkDialogCommand
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
 
        this.radRichTextEditor1.IsReadOnly = true;
        this.radRichTextEditor1.CommandExecuting += RadRichTextEditor1_CommandExecuting;
    }
 
    private void RadRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
    {
        if (this.radRichTextEditor1.IsReadOnly && e.Command is ShowInsertHyperlinkDialogCommand)
        {
            e.Cancel = true;
        }
    }
}

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RichTextEditor
Asked by
Bruce
Top achievements
Rank 2
Answers by
Hristo
Telerik team
Share this question
or