Hi,
I have a webgrid that has several fields with a combo editorcontroller to edit it. sometimes when I postback to update the database, when it comes back, I see the ID number for the field instead of the text. I have the controller's datatextfield and datavalue fields set properly. this only happens after the postback to rows other than the ones I just updated. it doesn't necessarily happen to all the other rows either. I'm out of ideas for what the problem could be. let me know if there's more information I could be providing.
Thanks in advance!
- Sarah
From the description this seems like an intermittent issue that might be hard to reproduce or diagnose on forums without the actual code. There might be some additional third party tool like AJAX toolki, UpdatePanel... something else in the code that makes that happen. This can also be related to versions (e.g. version of NetAdvantage, version of.NET, etc)
I believe in cases like that, the fastest way to proceed is to contact Developer Support directly via this link
http://devcenter.infragistics.com/Protected/SubmitSupportIssue.aspx
If you have a small subset of your project reproducing the issue, it will be much easier for them to figure out what is going on, since from what I see this one might be hard to reproduce.
Turns out it's not as intermittent as I thought. It always changes to IDs on all other rows that do not have the same Subcategory.
What I have is a part list...The user picks a category from a webcombo which invokes a selectWhere on the Subcategory webcombo and only shows the subcategories that goes with the category. The same thing for the parts webcombo, it chooses only parts in that subcategory. I've narrowed down the problem to this selectWhere...if I don't do this selectWhere, everything works great. Is there another way to do this?
Right now I have it in afterExitEditMode, but it does the same thing if I put the code in beforeEnterEditMode and change the column.Key values that will invoke the selectWhere.
function MainGrid_AfterExitEditModeHandler(gridName, cellId){ var cell = igtbl_getCellById(cellId); var row = cell.Row; var column = cell.Column; if (column.Key == "PartServiceID") { igtbl_needPostBack(gridName); } else if (column.Key == "Quantity") { igtbl_needPostBack(gridName); } else if (column.Key == "CategoryID") { var cat = row.getCell(2).getValue(true); if (cat) { var subcatCombo = igcmbo_getComboById('ctl00xcntContentxSubcategoryController'); subcatCombo.selectWhere("CategoryID='" + cat + "'"); } } else if (column.Key == "SubCategoryID") { var subcat = row.getCell(3).getValue(true); if (subcat) { var partCombo = igcmbo_getComboById('ctl00xcntContentxPartController'); partCombo.selectWhere("SubCategoryID='" + subcat + "'"); } } }
OK I found what the problem is. when the form posted back, the selectWhere was still set on the webcombos. so put the code I have above in beforeExitEditModeHandler (with the necessary changes). and set afterExitEditModeHandler to reset the selectWhere. so partCombo.selectWhere(""); so the problem was it was trying to read the DataTextField data that was no longer in the select. it worked on some of them if they had the same subcategory because the information was still in the data. I hope that makes sense for anyone else running into this problem.
Thanks for sharing the solution in public forums - much appreciated. I am sure other people will benefit from this.
Thanks again.