Heey Guys
got a strange error when I'm trying to open the page where the grid is
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). on line 18
got a strange error when I'm trying to open the page where the grid is
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). on line 18
function PrintRadGrid(radGridId) {
var radGrid = $find(radGridId);
var previewWnd = window.open('about:blank', '', '', false);
var sh = '<%= ClientScript.GetWebResourceUrl(UserGrid.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",UserGrid.Skin)) %>';
var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
var htmlcontent = styleStr + "<body>" + radGrid.get_element().outerHTML + "</body></html>";
previewWnd.document.open();
previewWnd.document.write(htmlcontent);
previewWnd.document.close();
previewWnd.print();
previewWnd.close();
radGrid.get_masterTableView().fireCommand("EnablePaging", "");
}
thanks for help and fast answer !
function PrintRadGrid(radGridId) { var radGrid = $find(radGridId); var previewWnd = window.open('about:blank', '', '', false); var sh = '<%= ClientScript.GetWebResourceUrl(UserGrid.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",UserGrid.Skin)) %>'; var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>"; var htmlcontent = styleStr + "<body>" + radGrid.get_element().outerHTML + "</body></html>"; previewWnd.document.open(); previewWnd.document.write(htmlcontent); previewWnd.document.close(); previewWnd.print(); previewWnd.close(); radGrid.get_masterTableView().fireCommand("EnablePaging", ""); }