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.
Syncfusion Feedback

Copy and Paste

Thread ID:

Created:

Updated:

Platform:

Replies:

17572 Aug 12,2004 08:13 AM UTC Aug 12,2004 10:59 AM UTC Windows Forms 3
loading
Tags: GridControl
arvind
Asked On August 12, 2004 08:13 AM UTC

Hai, I using a griddatabound Gird ,when I copy a string from one column and paste that value to another cell which is of type int my application is crashing an dexception is coming as "Input string is not in a correct format" How can stop a user from pasting a string value into a cell of type int.

Administrator [Syncfusion]
Replied On August 12, 2004 09:09 AM UTC

One way you can do this is to subscribe to the grid.Model.PasteCellText event. the event args will have the row and col and value being pasted. If you do not want it to be pasted (somehow decide whether it is an integer), set e.Cancel = true.

arvind
Replied On August 12, 2004 10:36 AM UTC

How do u call the event >Hai, >I using a griddatabound Gird ,when I copy a string from one column and paste that value to another cell which is of type int my application is crashing an dexception is coming as >"Input string is not in a correct format" >How can stop a user from pasting a string value into a cell of type int.

Administrator [Syncfusion]
Replied On August 12, 2004 10:59 AM UTC

You do not call the event. You subscribe to it, add your event handler, and then when the event is raised, your event handler code is hit. Normally, you never really call your code. Here is a sample that subscribes to the grid.Model.PasteCellText event. In the handler, the code checks if the values in column 2 are ints. If not, it does not allow the paste. GridDataBoundGridPasteCellText_6595.zip

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.

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

;