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
I have a WebGrid that has a dropdown list column and a text column:
<ISWebGrid:WebGridColumn Caption="Rule" DataMember="Rule" Name="Rule" Width="100px" ColumnType="Text" EditType="DropdownList"> <ValueList DataSourceID="SqlDataSource_Rule" DataTextField="DataText" DataValueField="DataValue" /> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Caption="Threshold" DataMember="Threshold" Name="Threshold" Width="100px">
When the user makes a selection in the dropdown list, I want the value in the second column to change.
Example: The dropdown list contains 2 items: 'KPH Limit' and 'MPH Limit'. If the user changes the dropdown to 'KPH Limit', I want the second column to change to "100". If the user changes the dropdown to 'MPH Limit', I want the second column to change to "65".
How do I detect when the value in the dropdown list has changed?
Thanks,
Jim
Hello Jim,
You can detect whether the value in the dropdownlist has changed by using OnExitEditMode client-side event in WebGrid.
When you add new handler in OnAfterExitEditMode, the code will look like following:
function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject) { var WebGrid1 = ISGetObject(controlId); return true; }
editObject is the parameter that you can use to get the type of the edited object, which is dropdownlist.
Then, you can determine the text selected from downdownlist by using editObject.cellElement.innerText. For example:
function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject) { var WebGrid1 = ISGetObject(controlId); alert(editObject.cellElement.innerText); return true; }
With this way, you can determine the changes that you have made in the dropdownlist.
Hope this helps. Thank you.
Regards,-Martin-
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