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.

GridDataBoundGrid "Cannot widen from target type to primitive type"

Thread ID:

Created:

Updated:

Platform:

Replies:

28798 May 10,2005 05:54 PM May 10,2005 10:53 PM Windows Forms 1
loading
Tags: GridControl
Cheunhui Wang
Asked On May 10, 2005 05:54 PM

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

Administrator [Syncfusion]
Replied On May 10, 2005 10:53 PM

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).

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.

;