How do I update a column in radGrid using JavaScript client side?
I can find the row that I am wanting to update the column in but can't figure out how to update the column itself. Changing the text value of the label control does not persist after the rebind.
I am reading the data from a SQL table but the data is never written back to the SQL server.
I can find the row that I am wanting to update the column in but can't figure out how to update the column itself. Changing the text value of the label control does not persist after the rebind.
I am reading the data from a SQL table but the data is never written back to the SQL server.
function updateTable() {
// "txt" here is the args sent to the "onReceive" function
// set txt value for testing purposes
var txt = 'HB2573';
// get the reference to the RAD grid
var grid = $find("<%=RadGrid1.ClientID %>");
// get the underlying table view
var MasterTable = grid.get_masterTableView();
// get the underlying data source
var items = MasterTable.get_dataItems();
// get the # of rows
var length = MasterTable.get_dataItems().length;
for (var i = 0; i < length; i++) {
// get the record
var record = MasterTable.get_dataItems()[i];
var keyValue = record.getDataKeyValue("fa_MeasureValue")
//alert(keyValue);
if (keyValue == txt) {
var CM = record.findElement("lblCurrentMeasure"); //access the Label control
//alert(CM.innerText);
CM.innerText = "1"; // assigning value to label control
//alert(CM.innerText);
} else {
var CM = record.findElement("lblCurrentMeasure"); //access the Label control
CM.innerText = "0"; // assigning value to label control
}
}
// and rebind it to the changed data
MasterTable.rebind();
}