iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
What is the proper way to set the WebGrid's DropDownList field's value?
Currently, I am using the following method which uses the field's SetChanges method which allows me to set the text and value:
function WebGrid_SetDropDownListValue(field, text, value) { try { // Set DropDownList's value if (field == null) { return; } field.SetChanges(text, value); } catch (ex) { ShowJSException(ex); } }
This causes a few problems:
1) It will set the text regardless if the VALUE exists in the DropDownList control
2) When binded, the VALUE is displayed instead of the TEXT. If you click the DropDownList control, the text is displayed. For example, if the following DropDownList contains 1/A and 2/B, if the underlying value is set to "B", the "B" is visible in the WebGrid unless the user clicks the control and then "2" is displayed.
Hi Shawn,
Since the DropDownList object already embedded in WebGrid's object it would be more efforts to get dropdown list object. I suggest you to use the WebCombo control by using the following code on OnRowSelect client-side event.
function WebGrid1_OnRowSelect(controlId, tblName, rowIndex, rowEl) { var WebGrid1 = ISGetObject(controlId); // WebGrid1.GetSelectedObject().ToRowObject().GetCells()[2].SetText("Condiments", true); return true; }
And I for your second problems, I did not replicate on my side. Have you use the latest build?
Thank you and have a nice day.
Regards,Niven.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname