Hello,
i have a problem: in my ASP page i have a RadGrid with ID="RGDati", i want to read the data into RadGrid cells via javascript;
I'm using this method:
function readData(){
var grid = window["<%# RGDati.ClientID %>"];
alert(grid); // output: "undefined"
for (var i = 0; i < grid.MasterTableView.SelectedRows.length; i++)
{
var row = grid.MasterTableView.SelectedRows[i];
var cellID = grid.MasterTableView.GetCellByColumnUniqueName(grid.MasterTableView.SelectedRows[i], "EmployeeID");
alert(cellID.innerText);
}
}
but it crash because grid is "undefined"!
If I use this statement
var grid = window["<%= RGDati.ClientID %>"];
i have this error message:
Error Message:The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Stack Trace: at System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) at Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated)
Please, can you help me?
i have a problem: in my ASP page i have a RadGrid with ID="RGDati", i want to read the data into RadGrid cells via javascript;
I'm using this method:
function readData(){
var grid = window["<%# RGDati.ClientID %>"];
alert(grid); // output: "undefined"
for (var i = 0; i < grid.MasterTableView.SelectedRows.length; i++)
{
var row = grid.MasterTableView.SelectedRows[i];
var cellID = grid.MasterTableView.GetCellByColumnUniqueName(grid.MasterTableView.SelectedRows[i], "EmployeeID");
alert(cellID.innerText);
}
}
but it crash because grid is "undefined"!
If I use this statement
var grid = window["<%= RGDati.ClientID %>"];
i have this error message:
Error Message:The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Stack Trace: at System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) at Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated)
Please, can you help me?