We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Disable copy/paste from the RichTextBoxAdv control

Thread ID:

Created:

Updated:

Platform:

Replies:

115506 Jan 20,2014 06:35 PM Jan 23,2014 01:20 AM WinRT 3
loading
Tags: General
Timothy J Eicher
Asked On January 20, 2014 06:35 PM

I am looking for a way to disable the ability to copy and paste from the SfRichTextBoxAdv control. Is there a way to explicitly do this?

Or alternatively, is there a way to disable selection so that copy can't be performed?

Thanks!

Gunasekaran T [Syncfusion]
Replied On January 21, 2014 04:10 AM

Hi Timothy,

Thank you for your interest in Syncfusion products.

In SfRichTextBoxAdv control it is not possible to specifically disable copy/paste or selection functionality. Instead we can disable entire edit (Including copy/paste) functionality by setting IsReadOnly property to true. Please do find the code snippet to set IsReadOnly property from below.

Code Snippet:
[XAML]
<syncfusion:SfRichTextBoxAdv x:Name="richTextBoxAdv" IsReadOnly="True" ManipulationMode="All" />

[C#]
richTextBoxAdv.IsReadOnly = true;

Please let us know if you have any other questions.

Regards,
Gunasekaran


Timothy J Eicher
Replied On January 21, 2014 11:44 AM

Thanks for the reply!
Setting IsReadOnly to True has not disabled copy/paste for me. I can still select text, and use Ctrl-C to copy and paste the text to another location.
I've been able to find a solution that locks down copy/paste from keyboard events, but it would be nice if it could be explicitly disabled from the control.

Gunasekaran T [Syncfusion]
Replied On January 23, 2014 01:20 AM

Hi Timothy,

Thank you for your update.

Regarding “Setting IsReadOnly to True has not disabled copy/paste for me”:
In general setting IsReadOnly to true will disable only the edit functionality within the particular control (Cut/Paste content in to control will be disabled), and copy functionality will work as normal, since copying selected content to system Clipboard does not lead to any edit operation within the control. This behavior is common to all Text box control and the same behavior is implemented in SfRichTextBoxAdv control.

In order to disable Copy/Cut/Paste option from keyboard events in SfRichTextBoxAdv control, we can create a custom control inheriting SfRichTextBoxAdv and override the KeyDown events to disable Copy/Cut/Paste operations explicitly. Please do find the sample for the same from attachment.

Please let us know if you have any other questions.

Regards,
Gunasekaran



SfRichTextBoxAdvSample_757ce2da.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;