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.
Unfortunately, activation email could not send to your email. Please try again.

how to Stop/Cancel Paste operation

Thread ID:

Created:

Updated:

Platform:

Replies:

97002 Oct 19,2010 10:05 PM Nov 2,2010 09:42 AM Windows Forms 1
loading
Tags: GridControl
nazmi anuar
Asked On October 19, 2010 10:05 PM

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


Yuvaraja V [Syncfusion]
Replied On November 2, 2010 09:42 AM

Hi,

Thank you for your interest in Syncfusion products.

In DataBoundDataGrid, We Can Cancel the paste option by using Result property with the following code,

void Model_ClipboardCanPaste(object sender, Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs e)
{
GridCurrentCell cc1 = this.gridDataBoundGrid1.CurrentCell;

if (cc1.Renderer.ControlText.Length>4)
{

e.Handled = true;
e.Result = true;

//Set Result Property to False to disable the process.

}
else if (cc1.Renderer.ControlText.Length>=3)
{
e.Handled = true;
e.Result = false;
}
}

private void Paste_Click(object sender, EventArgs e)
{
this.gridDataBoundGrid1.Model.CutPaste.Paste();
}

here is the link for the sample

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=PasteSample-1054322200.zip


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.

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.

;