CheckedRows cellValue

1 reply. Last post: March 12, 2010 2:45 AM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

I have a grid with a IsRowChecker column and i want to access a particular value on client side, for all the checked rows.

When the user check a individual row the following code works fine.

But when the user check all the rows with the checkbox in the row header, the cellValue property is undefined.

How can i access the cell value? (The cell text and value must be differents)

/// Javascript function

var grid = ISGetObject('WebGridComissions');
var table = grid.GetRootTable();
var checkedRows = table.GetCheckedRows();
for (var i = 0; i < checkedRows.length; i++){
alert(checkedRows[i].cells[4].cellValue); //Cell value
alert(checkedRows[i].cells[4].innerText); // Cell text
}


/// Server side

protected void WebGridComissions_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
if (e.Row.Type == ISNet.WebUI.WebGrid.RowType.Record)
{
ISNet.WebUI.WebGrid.WebGridCellCollection cells = e.Row.Cells;
DataRowView dr = (DataRowView)e.Row.DataRow;
int classId = (int)dr["Id"];
cells.GetNamedItem("ClassName").Value = classId;
}
}
All times are GMT -5. The time now is 11:13 AM.
Previous Next