Intersoft WebCombo Documentation
How-to: Set the value of another controls in OnAfterItemSelected client side events
See Also Send comments on this topic.
Intersoft WebCombo > WebCombo Features Overview > Client-side Programming How-to Topics > How-to: Set the value of another controls in OnAfterItemSelected client side events

Glossary Item Box

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

  1. Drag a WebCombo instance into the WebForm.
  2. Add the following function in client side:

    JavaScript Copy ImageCopy 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;
    }
    

  3. Invoke WebCombo1_OnAfterItemSelected() function in OnAfterItemSelected client side event of WebCombo.
  4. Run the project.

See Also