I want to get the values of the selected checkbox in a RadGrid. I have a radgrid, textbox and a button as follows:
this._RadAjaxPanel.Controls.Add(RadGrid1);
this._RadAjaxPanel.Controls.Add(TextBox1);
this._RadAjaxPanel.Controls.Add(Buton1);
The radgrid id is set to RadGrid1 and
Button1.OnClientClick = "GetSelectedItems("+ this._RadGrid1 +")";
On click of the button a javascript is called where I want to know which rows have been selected. The javascript function is as follows but it is not correct:
function GetSelectedItems(grid) {
var selectedRows = grid.get_selectedItems();
for (var i = 0; i < selectedRows.length; i++) {
var row = selectedRows[i];
var cell = grid.getCellByColumnUniqueName(row, "CategoryID")
//here cell.innerHTML holds the value of the cell
}
}
Please let me know how can I get the selected rows.