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
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