GridDataBoundGrid "Cannot widen from target type to primitive type"

Hi: when user edits a cell bound to double type in databound grid, If the user leaves the cell empty before exiting the cell, a popup message "Cannot widen from target type to primitive type" is generated. We would like to change this behavior, instead of a popup message, we want to change the value of the cell to 0 and no message box, is there a way to do it? Thanks, Chunhui

1 Reply

AD Administrator Syncfusion Team May 11, 2005 02:53 AM UTC

In CurrentCellValidating, you can test for grid.CurrentCell.Renderer.ControlText.Length == 0. If this is the case, try setting grid.CurrentCell.Renderer.Control.Text = "0". (Note, one of these is ControlText and the other is Control.Text).

Loader.
Up arrow icon