Events and pasting into multiple cells

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

1 Reply

AD Administrator Syncfusion Team March 2, 2007 05:49 PM UTC

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

Loader.
Up arrow icon