validation of excel grid paste into syncfusion grid

Hi,

How do I validate the range of cells being pasted into a syncfusion grid?

Basically, I have an application with a grid that's 10 columns long. I want to make sure that when a user pastes contents from Excel, the application can validate to ensure that the pasted contents are a grid of 10 columns.

I know that I can use:
this.gridGroupingControl1.TableModel.ClipboardPaste += new GridCutPasteEventHandler(TableModel_ClipboardPaste);

But within the actual TableModel_ClipboardPaste(...) method I only know of how to retrieve the clipboard contents as a string. is there a neater way?


1 Reply

YV Yuvaraja V Syncfusion Team December 9, 2010 10:54 AM UTC

Hi Gav,

Thanks for using syncfusion products.

The default behavior for a gridControl is to paste what is on the clipboard and append rows and columns if neccessary.To avoid you would use the "ClipboardFlags" property.It prevents the appending of rows and columns.The following code illustrates the same.

e.ClipboardFlags = GridDragDropFlags.NoAppendCols;
e.ClipboardFlags = GridDragDropFlags.NoAppendRows;


Let us know if you have any other concerns.

Regards,
Yuvaraja V.


Loader.
Up arrow icon