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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Enable only Paste Value on Context Menu

Thread ID:

Created:

Updated:

Platform:

Replies:

142300 Jan 25,2019 07:01 PM UTC Jan 28,2019 11:19 AM UTC WinForms 1
loading
Tags: Spreadsheet
Spotty
Asked On January 25, 2019 07:01 PM UTC

I'm working on a spreadsheet and using the context menu to implement a Cut/Copy/Paste implementation.

However I only want the user to be able to paste values and not formula/formatting etc.

I can't seem to find a way to do this - in the context menu I could think about removing/hiding the items and creating my own implementations however this would seem like a lot of work and wouldnt cover the use of any of the shortcut keys such as Ctrl+V.

Any pointers in best way to implement this Paste Only Value functionality.

Arulraj A [Syncfusion]
Replied On January 28, 2019 11:19 AM UTC

Hi Spotty, 

Thanks for using Syncfusion product. 

Suggestion1 

By default, Spreadsheet does have the support to change the default paste option using DefaultPasteOption property. Please refer the following code example. 

VB 
Me.spreadsheet.CopyPaste.DefaultPasteOption = Syncfusion.Windows.Forms.Spreadsheet.PasteOptions.Value 

To avoid the paste popup showing when press the ctrl+v, you could disable the AllowPasteOptionPopup property. Please refer the following code example. 

VB 
Me.spreadsheet.CopyPaste.AllowPasteOptionPopup = False 

Suggestion2 

Also, you can set the default paste option using PateOption property in Pasting event which is only paste the value based on the PasteOption value. Please refer the following code example. 

VB 
AddHandler Me.spreadsheet.CopyPaste.Pasting, AddressOf SpreadSheet_Pasting 

Private Sub SpreadSheet_Pasting(sender As Object, e As SpreadsheetPastingEventArgs) 
    e.PasteOption = Syncfusion.Windows.Forms.Spreadsheet.PasteOptions.Value 
End Sub 


Please refer the below UG link for programmatical implementation for Cut/Copy/Paste operations 

Please let us know if you need any further assistance on this. 

Arulraj A 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;