Hello,
In some cases we do not allow users to paste large content objects such as images. The RTF size just gets too large too fast with images and we end up with Large Object Heap fragmentation very quickly which eventually results in Out of Memory exceptions. Another option would be to scale down the image resolution for the user to reduce the memory size (we do not do that).
How to prevent a specific content from being pasted into RichEditControl
Answers approved by DevExpress Support
Hi Clint,
If you wish to analyze and execute custom logic when an RTF content is inserted in a RichEditControl instance, you can implement it in a custom PasteSelectionCommand command.
Please refer to the following threads, where we have demonstrated how it can be achieved:
Floating is not Working in RichTextEdit
How to customize copy and paste commands
I have created a simple sample that illustrates how to analyze the inserted content in a custom PasteSelectionCoreCommand descendant. Please find it in the attachement.