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. Image for the cookie policy date

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.
Live Chat Icon For mobile
Up arrow icon