Completed
Last Updated: 18 Aug 2020 12:40 by ADMIN
Release R3 2020
Pardeep
Created on: 10 Aug 2020 09:52
Category: SyntaxEditor
Type: Bug Report
0
RadSyntaxEditor: delete button deletes data from syntaxeditor after making it readonly

Hi Team , I want to make my syntax editor readonly and user should not be able to make any changes.

I have made my

((Telerik.WinControls.UI.RadSyntaxEditorElement)(this.radSyntaxEditor.GetChildAt(0))).IsReadOnly = true; .

But still the user is able to delete the data by pressing delete button .

How can we restrict this.

I also tried radSyntaxEditor.enabled=false. It disables editing but the are is greyed out.

 

Thanks

2 comments
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 10 Aug 2020 11:18

Hello, Pardeep,

I was able to observe the described behavior. Even the copy/paste operation shouldn't be allowed when the SyntaxEditor.IsReadOnly property is enabled.

I have logged it in our feedback portal by creating a public thread on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to handle the PreviewSyntaxEditorKeyDown event and set the PreviewSyntaxEditorKeyEventArgs.OriginalArgs.Handled property to true if the syntax editor is read-only. 

        public RadForm1()
        {
            InitializeComponent();

            this.radSyntaxEditor1.SyntaxEditorElement.IsReadOnly = true;

            this.radSyntaxEditor1.PreviewSyntaxEditorKeyDown+=radSyntaxEditor1_PreviewSyntaxEditorKeyDown;
        }

        private void radSyntaxEditor1_PreviewSyntaxEditorKeyDown(object sender, Telerik.WinForms.Controls.SyntaxEditor.UI.PreviewSyntaxEditorKeyEventArgs e)
        {
            e.OriginalArgs.Handled = this.radSyntaxEditor1.SyntaxEditorElement.IsReadOnly;
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Pardeep
Posted on: 10 Aug 2020 09:52
adding email address for communication