Hi everyone,
anyone knows how to set the value of a UltraWinGrid cell to null (Nothing in VB.NET). I've tried this code but it does'nt work
For Each gridCell As Infragistics.Win.UltraWinGrid.UltraGridCell In gridCells
gridCell.Value = Nothing
Next
If the cell already contains the null value I don't receive any error message and everything works fine. But, if the cell contains a value (in that case an integer) I cannot set back the value to nothing and I receive this error message : Unable to convert from (null) to 'System.Nullable'1[System.Int32]
Anyone konws how to do such things???
What version of the grid do you have? Are you using the latest Hot Fix? There were some bugs in older versions when dealing with Nullable types.
What kind of data source are you using for your grid?
Have you tried:
gridCell.Value = DBNull.Value
1 -We use version 6.2.20062.34. Of the NetAdvantage for .Net 2006.2 CLR 2.0
Where can I find the hotfix you've talked about?
2 - I use a generic list (List(Of "my object with nullable property")
3 - I've tried to use DBNull.value but it does not works.
To be clearer, I've bond a grid with a list of a certain object type containing some nullable fields. When binding, the grid works properly. I've also placed in some cells of the grid Ultra dropdown to display data in a way much more user friendly.
After the binding of the grid I try to remove the value contained in a cell (the object property binded to this cell is set to a nullable type (Nullable(Of Integer)) but each time I try to do that I receive the following error message : "Unable to convert from (null) to 'System.Nullable'1[System.Int32]".
I think it's because the null value of the cell is not equivalent to the .NET 'System.Nullable' type.
Maybe it's because the cell does'nt know the type of the object property is binded to? Could I Set the datatype of the cell content?
What do you think?