I have a GridTemplateColumn like following.
When I click the first edit image button, it work fine, but when I click the second one, it alert an error message,” Microsoft JScript runtime error: Object doesn't support this property or method.”
How to solve this problem?
Many thanks for your helping.
function EditCategory()
{
var grid = $find("<%=RadGrid_Category.ClientID %>");
var MasterTable = grid.get_masterTableView();
var selectedRows = MasterTable.get_selectedItems();
for (var i = 0; i < selectedRows.length; i++)
{
var row = selectedRows[i];
var cell = MasterTable.getCellByColumnUniqueName(row, "CategoryID");
var CategoryID= cell.innerHTML; //holds the value of the cell
}
window.radopen("EditCategory.aspx?
CategoryId="+CategoryID, "EditCategory");
}
<telerik:GridTemplateColumn HeaderText="Edit"
UniqueName="TemplateColumn">
<ItemTemplate>
<asp:ImageButton ID="ImageButton_Edit" runat="server"
OnClientClick="EditCategory(); return false;"
ImageUrl="/EditorPr.gif" />
</ItemTemplate>
</telerik:GridTemplateColumn>