AD
Administrator
Syncfusion Team
December 17, 2005 10:02 AM UTC
If you are pasting text (for example, this is always the case in a GridDataBoundGrid or is the case when you in a GridControl when you copy from another object like an Excel spreadsheet), then you can use the grid.Model.PasteCellText event to validate the text being pasted.
But if you are copy from a GridControl and paste in a GridControl, then by default style objects are copied and pasted, and PasteCellText is not raised. In this case, you can either turn off support for copying styles (allowing only text to be pasted and PasteCellText to be hit) or you can handle the grid.ClipboardPaste. In ClipboardPaste, you would have to get the GridData object from the clipboard, validate it somehow. Working with PasteCellText is much simpler as it provides the proposed text cell by cell. To turn off style copy/paste support in a gridcontrol, turn off this flag.
this.gridControl1.Model.CutPaste.ClipboardFlags &= ~GridDragDropFlags.Styles;