Earn Cash from forex trading and free 5$ for Regiatation.

Wednesday, December 3, 2008

Retrieve value of the selected rows in WebCombo on the client

Accessing the selected rows in a WebCombo requires accessing its underlying WebGrid control. The following example uses the AfterSelectChange client-side event of the WebCombo to get the selected row's cell values, and displays each value in an alert() dialog.



In JavaScript:

function WebCombo1_AfterSelectChange(webComboId)
{
// get the combo from the passed-in id
var combo = igcmbo_getComboById(webComboId);

// get the currently selected row in webcombo
var index = combo.getSelectedIndex();

// get grid reference from webcombo
var grid = combo.getGrid();

// get selected row in grid
var row = grid.Rows.getRow(index);

// get cell values in row
alert(row.getCell(0).getValue());
alert(row.getCell(1).getValue());
alert(row.getCell(2).getValue());
alert(row.getCell(3).getValue());
}


0 comments: