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

CellValueType = int, Value = null

I need to have a cell that is initially empty, but that has a cellvaluetype of int. I find that if I set the cellvaluetype to int, but do not set the cellvalue to an integer, then I get the following exception: System.Exception: is not a valid value for Int32. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.String.get_Chars(Int32 index) at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) I could ignore the cellvaluetype, ie leave it as text, but then I lose the built-in valuetype checking. Going further, I could also do my own validation, but that seems like I''m working against the grid rather than with it. Am I missing something obvious? This seems like a fairly common need: cells that have a an assigned type but that are blank until data is entered.

1 Reply

AD Administrator Syncfusion Team January 6, 2004 06:49 AM UTC

What version of our grid are you using? Unless I am missing something, I do not see a problem in trying to have CellValueType = typeof(int) and CellValue = null in this sample that has both a GridControl and a GridDataBoundGrid with such cells. forum_cellvaluetype_6389.zip

Live Chat Icon For mobile
Up arrow icon