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.
Unfortunately, activation email could not send to your email. Please try again.

Validate user paste into cell . .

Thread ID:

Created:

Updated:

Platform:

Replies:

38745 Dec 16,2005 05:49 PM Dec 17,2005 05:02 AM Windows Forms 1
loading
Tags: GridControl
Adam K.
Asked On December 16, 2005 05:49 PM

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 05:02 AM

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;

CONFIRMATION

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.

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.

;