how to Stop/Cancel Paste operation

Hi there,

im using Grid Data Bound Grid and explicitly call the grid.Model.CutPaste.Paste()
and then im doing the validation of value pasted in the
Model.DataProviderSaveCellInfo event..

how do i stop the paste operation from the DataProviderSaveCellInfo whenever my custom validation is failing..

thanks


1 Reply

NR Nirmal Raja Syncfusion Team October 26, 2010 12:56 PM UTC

Hi Nazmi,

Thank you for your interest in Syncfusion products.

You can make use of the ClipboardPaste event in which the condition can be checked and can block the paste operation by enabling the Handled property.

Please refer the code below:
void Model_ClipboardPaste(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
{
if (gridDataBoundGrid1.Model[gridDataBoundGrid1.CurrentCell.RowIndex, gridDataBoundGrid1.CurrentCell.ColIndex].Text.StartsWith("Name"))
e.Handled = true;
}


Also refer the sample attached in the below location:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GDBGCopypaste-1759324832.zip

Let me know if you have any concern.

Regards,
Nirmal


Loader.
Up arrow icon