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. Image for the cookie policy date
close icon

Catching the PasteCellText event.....

I have a simple test program with one syncfusion grid. I am trying to catch when the user has pasted some text into the grid by registering a PasteCellText function like so:

public Form1()
{
InitializeComponent();
gridControl1.PasteCellText += this.onPaste;
}

the function onPaste looks like

private void onPaste(object sender, GridPasteCellTextEventArgs e) {
Debug.Write("Paste");
}

but this is not called when I paste text into any cells!

The full solution is attached but contains nothing more than these lines.

Am I missing something here??

Any help appreciated!

Regards

Colin



WindowsApplication172.zip

2 Replies

CO Colin January 29, 2007 01:22 PM UTC

It seems that pasting text from the table to itself does not fire the event but copynig and pasting text from another source (such as Notepad) does fire the event correctly.

Is this a known issue?


AD Administrator Syncfusion Team January 29, 2007 01:32 PM UTC

If you are copy from a GridControl and paste in a GridControl, then by default style objects are copied and pasted, and PasteCellText is not raised. To see the PasteCellText event raised, you can turn off support for copying styles (allowing only text to be pasted and PasteCellText to be hit). To turn off style copy/paste support in a gridcontrol, turn off this flag.

this.gridControl1.Model.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles;

Loader.
Live Chat Icon For mobile
Up arrow icon