In WebCombo, you can set selected row in Unbound WebCombo from Client-side.
This topic will show you how to set selected value from WebCombo on Client-side
To set selected value in WebCombo from Client-Side
- Go to HTML View and put the following code:
<input id="Button1" type="button" value="SetValue" onclick="SetValue()" />
- Create function SetValue() in client side and add one of the these codes based on your need:
JavaScript Copy Code function SetValue() { // To Set selected Value Directly var combo = ISGetObject("WebCombo1"); combo.SetText("Brian"); alert("Text set to Brian"); }
JavaScript Copy Code function SetValue() { // To Set selected Value by Index var combo = ISGetObject("WebCombo1"); combo.SetSelectedIndex(2); alert("Set value by index 2"); }
JavaScript Copy Code function SetValue() { // To Set selected Value by KeyValue var combo = ISGetObject("WebCombo1"); combo.SetSelectedRowByValue("Andrew"); alert("Set value by KeyValue Andrew"); }
JavaScript Copy Code function SetValue() { // To Set selected Value by RowObject var combo = ISGetObject("WebCombo1"); var rows = combo.GetRows(); var row = rows[1]; row.Select(); alert("Set value by calling Select() method of a WebComboRow object"); }
- Run the project.
Tasks
How-to: Modify the first cell of the first row in unbound WebCombo
How-to: Delete a row in unbound WebCombo
How-to: Add item in unbound WebCombo from client side
How-to: Perform batch update in unbound WebCombo
How-to: Create unbound WebCombo using PopupateUnboundData method
Concepts
Unbound Mode