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

GridDataBoundGrid crashes when pasting full row of data containing incorrect data type

Hi, I'm using Syncfusion 4.2.0.37.

I created a GridDataBoundGrid instance and bound it to a data table containing two columns that have string and integer data types.

If I *click on the row header* (this is important) paste a line of text "ABC123", it works but if i paste "ABCDEF", it crashes the whole application immediately.

It seems that none of the validation event handlers are called - is there anyway to work around this? Must I change the numeric column to string and validate the cell myself?

Thanks.

1 Reply

AD Administrator Syncfusion Team April 27, 2007 04:52 PM UTC

To do validation when paste in a GridDataBoundGrid, you need to subscribe to grid.Model.PasteCellText event. There you can validate e.Text based on e.RowIndex, e.ColIndex, e.Style, etc. If you want to not paste a cell but continue pasteing other cells, you can set e.Cancel = true. If you want to stop all pasteing, you set e.Abort = true.

Loader.
Live Chat Icon For mobile
Up arrow icon