Completed
Last Updated: 31 Oct 2013 02:13 by ADMIN
ADMIN
Dimitar
Created on: 31 Oct 2013 02:13
Category:
Type: Bug Report
2
FIX. RadRichTextBox - when the ReadOnly property is set to true you can still paste.
To reproduce:
- Place RadRichTextBox in a blank form.
- Set its ReadOnly property to true.
- Copy some text and then press Ctrl+V in the RadRichTextBox.

Workaround:
- Use the following InputBehaviour:
class MyInputBeaviour : InputBehavior
{
    public MyInputBeaviour(DocumentView view)
        : base(view)
    {
    }

    protected override void PerformPasteOperation(KeyEventArgs e)
    {
        if (!this.DocumentView.IsReadOnly)
        {
            base.PerformPasteOperation(e);
        }
    }
}

- You can change the default behaviour like this:
radRichTextBox1.RichTextBoxElement.ViewElement.DocumentView.InputBehavior = new MyInputBeaviour(radRichTextBox1.DocumentView);
0 comments