To access RadGrid on client, use following code.
I will also show the code that doesn't work:
I will also show the code that doesn't work:
// didnt work. .Net crash saying The Controls collection cannot be modified because the control contains code blocks (i.e. <%--<% %>--%>)
<%--var grid1 = $find("<%= RadGrid1.ClientID%>");--%>
//didnt work. This just gives Null.
<%--var grid1 = $find("<%# RadGrid1.ClientID%>"); --%>
//didnt work. This just gives Null.
<%--var grid1 = document.getElementById('<%# RadGrid1.ClientID%>') --%>
//didnt work. It give me ID of RadGrid; not a reference to object.
var grid1 = document.getElementById('RadGrid1').id;
//This gives reference as htmldiv control which still cant be used to access functions of radgrid.
var grid1 = document.getElementById('RadGrid1')
// THIS WORKS **********************************************
var grid = $find(document.getElementById("RadGrid1").id);
var masterTable = grid.get_masterTableView();
//********************************************