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

ClipboardCanPaste is executed twice by the grid

Thread ID:





36104 Oct 20,2005 07:16 AM UTC Oct 21,2005 01:18 AM UTC WinForms 5
Tags: GridControl
I Gusti Ngurah Wirawan
Asked On October 20, 2005 07:16 AM UTC

Hi, I have a problem where ClipboardCanPaste is executed twice by the grid when i call Ctrl-V. In menus in the form i had edit menu where contains Cut, Copy, Paste operation where each shorcut are Ctrl-X, Ctrl-C and Ctrl-V. In each submenus i add code to send keys to the control, like this: SendKeys.Send("^(V)"); How can i solve this problem? thanks wirawan

I Gusti Ngurah Wirawan
Replied On October 20, 2005 08:57 AM UTC

attaching a sample of code.


Administrator [Syncfusion]
Replied On October 20, 2005 09:13 AM UTC

Here is sample that has a ctl+V Paste menu item that works on the grid and the ClipboardCanPaste is only hit once for me using version 3.3. http://www.syncfusion.com/Support/user/uploads/GDBG_CtlV_40c5bd3c.zip

I Gusti Ngurah Wirawan
Replied On October 20, 2005 09:41 AM UTC

thanks for your quick response. the problem is i must do as same as when i click the paste submenus as i do Ctrl-V to others control, so i use this code "SendKeys.Send("^(V)");". and when i add that code in your solution it still raise ClipboardCanPaste executed twice. any other idea that u can share with me. regards wirawan

Administrator [Syncfusion]
Replied On October 20, 2005 10:12 AM UTC

In the sample I sent, the event was only hit once, correct? You can put a check in your CanPaste handler to only do your code once. Here is a handler that I used in your sample to only display th emessage box once.
private void DataBoundGridModel_ClipboardCanPaste(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
	e.Handled = true;
	bool controlKeyDown = (Control.ModifierKeys & Keys.Control) != Keys.None;
		MessageBox.Show("can paste called");

I Gusti Ngurah Wirawan
Replied On October 21, 2005 01:18 AM UTC

Thanks Clay, its working.


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