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?
Ooo, just figured out that the attachment is the Default.Rar, which I have never seen before. After searching for the freeware...
I am working in VS2005, .net 2.0, ASP.net with VB.net, (not C#), and Infragistics NetAdvantage for .NET v7.2.20072.1069. I could not use your example because it was missing a file...
I should also note that I am creating the data sources in code, as I must provide a primary key value to the grid data that can vary when the user pushes next and previous buttons, and that the grid is in xml mode.
.DataSource = GetDataSet()
.DataValueField = "CustomerID"
.DataTextField = "ContactName"
' .Columns.FromKey("CustomerID").Hidden = True
.ComboTypeAhead = Infragistics.WebUI.WebCombo.TypeAhead.Suggest
End Sub
Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns.FromKey("ContactName").AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes
End SubThe primary key is CustomerID. I tested with the version of NetAdvantage you have and it worked fine.
Thanks for your example.
This seems counter intuitive. To use the contactName field as the editorControlId field when I want to update the CustomerID field...
Anyway, the problem was fixed in a hotfix update that I did not have installed. However, this update causes java errors with the AddNew button on the bottom of the grid. These errors first appeared when Micrsoft relased service pack 1 for the .net 2.0. I have scanned the postings and found others were facing these issues as well.
Unfortunately, my client will not upgrade to the latest volume of netvantage under the current economic conditions, So I am stuck.