You can set value of another controls using OnAfterItemSelected client side event.
In this topic, you will learn how to implement the method.
To set value to another control in OnAfterItemSelected event
- Drag a WebCombo instance into the WebForm.
- Add the following function in client side:
JavaScript Copy Code function WebCombo1_OnAfterItemSelected(controlId) { var comboFirstName = ISGetObject("WebCombo1"); var grid = ISGetObject("WebGrid1"); var row = grid.GetSelectedObject().GetRowObject(); if(comboFirstName.Text == "Andrew" || comboFirstName.Text == "Michael") { var cells = row.GetCells(); var cellCity = cells.GetNamedItem("City"); cellCity.SetText("Redmond"); cellCity.SetValue("Redmond"); } return true; }
- Invoke WebCombo1_OnAfterItemSelected() function in OnAfterItemSelected client side event of WebCombo.
- Run the project.