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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Validate user paste into cell . .

Thread ID:





38745 Dec 16,2005 10:49 PM UTC Dec 17,2005 10:02 AM UTC WinForms 1
Tags: GridControl
Adam K.
Asked On December 16, 2005 10:49 PM UTC

i have successfully validated all user keypress by using the Grid_CurrentCellValidateString event, but that doesn''t stop someone from copying and pasting a bad value into the cell. Is there anyone please to validate this paste operation or do i have to put this code in the Grid_CurrentCellValidating event . . -ak

Administrator [Syncfusion]
Replied On 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;


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon