I am running a WebGrid with an embeddable editor webcombo as a value list. I set up the feature using the examples in the documentation and the grid loads as expected. The value columns is a Int32 column, as is the column of the webgrid. The text column is a list of text options to choose from. However, when the user selects an item in the webcombo, the value returned is 0, not the Int32 value for the selected row.
After playing around, I discovered that the value will only be set when the webcombo's DataValueField and DataTextField properties are pointing to the same field in the webcombo data source.
Why is this happening?
I get the same problem with the built in value list. Both columns in the value list have to be the same in order for the lookup to work.
Hello,
When you using the properties DataTextField and DataValueField of webcombo inside grid it is importatnt to have in a matching value type of DataValueField and the type of the column. In your case you have different types and for that reason UltraWebGrid returns default value which for Int32 is 0 (zero). Please take a look at the attached sample (datasource is Northwind).Hope this helps.
Thanks.
Well actually both the datavalue field and column 1 data types are Int32. That's what is so strange. By the way, where is the attached sample?