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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid "Cannot widen from target type to primitive type"

Thread ID:





28798 May 10,2005 09:54 PM UTC May 11,2005 02:53 AM UTC WinForms 1
Tags: GridControl
Cheunhui Wang
Asked On May 10, 2005 09:54 PM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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