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.

Events and pasting into multiple cells

Thread ID:

Created:

Updated:

Platform:

Replies:

57389 Mar 2,2007 11:49 AM Mar 2,2007 12:49 PM Windows Forms 1
loading
Tags: GridControl
Chris
Asked On March 2, 2007 11:49 AM

Is there documentation somewhere that will walk me through what happens when someone pastes values into multiple cells at once?

If someone pastes into multiple cells at once I want to be able to validate each of the individual cell values, and then once all of the pasted cells are validated I want to refresh the grid data from the database. I've got this working now with single cell pasting, but I'm not sure what events I should be following for pasting into multiple cells.

Thanks!

Chris

Administrator [Syncfusion]
Replied On March 2, 2007 12:49 PM

Hi Chris,

One way to handle this is in your PasteCellText event handler, you can check if the cell being past in is one you want to paste or not. If not, return e.Cancel = True. You could do this by checking the row & col, or by checking a e.Style property like e.Style.ReadOnly for example.

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

this.gridControl1.Model.PasteCellText += new GridPasteCellTextEventHandler(Model_PasteCellText);
void Model_PasteCellText(object sender, GridPasteCellTextEventArgs e)
{
if( e.Text != "SomeValue")
{
Console.WriteLine(e.RowIndex + ":::" + e.ColIndex);
e.Cancel = true;
}
}

Best regards,
Haneef

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.

;