We upgraded this morning as mentioned above and now every webdatagrid in the entire project that has a cell editor throws an exception. The exception is
System.InvalidCastException: The default value string, , for column FK_checklistTypeID cannot be converted to the correct type, System.Int32. This was not occuring with the previous version of NetAdvantage.
All grids that do not have cell editors remain uneffected. Basically these grids that have editors are databinding to other database tables to allow the edit process to take place within the grid. Instead of showing a city number we would show city name but when selected the number is stored rather than the city text.
Any thoughts on where to go with this?
This post needed to go into the webdatagrid forum and not the ultrawebgrid forum. Sorry no way to move it.
Hello adhorgan ,
Thank you for posting this.
I guess that you have RowAdding behavior and <ig:RowAddingColumnSetting>
A new property was introduced in v 11.1 which causes the exception:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1?page=Infragistics4.Web.v11.1~Infragistics.Web.UI.GridControls.RowAddingColumnSetting~DefaultValueAsString.html
The issue is already fixed and the new service release will include it.
Issue 78973 : "The default value string for column cannot be converted to the correct type" is thrown if DefaultValueAsString is not set
You should set some default value at this time as temporary solution.
Let me know if you need further assistance.
Can you put an example up on how to set the defauilt column value?
Hello ,
Please refer to the code snippet below regarding setting default value when the column type is integer:
<ig:EditingCore >
<Behaviors>
<ig:RowAdding>
<ColumnSettings>
<ig:RowAddingColumnSetting ColumnKey="ID"
DefaultValueAsString="1" EditorID="WebDataGrid1_DropDownProvider1" />
</ColumnSettings>
</ig:RowAdding>
</Behaviors>
</ig:EditingCore>
Let us know if you need further assistance.
I'M having the same issue with a WHDG; your fix worked for me but; When is the hotfix going to be released? Also, I don't like to have a default value displayed in the adding row.
Hello kgill,
Can you please provide a sample code reproducing the issue?
I also had this issue after upgrading. Adding DefaultValueAsString helped, but not when you have a webhierarchicaldatagrid with child bands. When attempting to expand a band, the same error occurs (In an alert box on client side).
Does anyone have a fix for this?