This is a migrated thread and some comments may be shown as answers.

new external skins assembly breaks some code?

6 Answers 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 14 Dec 2011, 08:51 PM
I have a page which prints the contents (a grid)  of a rad pane. I want the grid skin styles to get printed so I use

ClientScript.GetWebResourceUrl(GetType(RadGrid),"Telerik.Web.UI.Skins.Office2007.Grid.Office2007.css")

and then pass the result as an absolute path to the pane.print() method.

This doesn't seem to work since upgrading to the latest controls and the external Skins assembly. It worked before.

The "Telerik.Web.UI.Skins.Office2007.Grid.Office2007.css" seems like it ought to work, but my print page is not applying the grid skin. Is there some alteration I need to make to this code to reference the grid skin?

6 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 15 Dec 2011, 02:57 PM
Hi Albert Shenker,

This issue is due to a breaking change of the Q3 2011 release, where all existing skins, except Default, are moved to a separate skins assembly(Telerik.Web.UI.Skins.dll). For Page.ClientScript.GetWebResourceUrl this means that it may not identify the embedded resource by a type in Telerik.Web.UI.dll, if that resource is in Telerik.Web.UI.Skins.dll. As embedded resources have now changed their place, your GetWebResourceUrl() code will not work. Please, read the following blog post, that describes the alternatives you can utilize.
 
All the best,
Milena
the Telerik team

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 20 Dec 2011, 03:44 PM
ok, I made the change and it works in most scenarios. However I am running into one problem. I have the following code which prints the content of a grid and some additioal content:
function PrintDashboardGrid(gridId, title) {
 
var gridSkinUrl = '<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(Me.Page, GetType(RadGrid), "Telerik.Web.UI.Skins.Office2007.Grid.Office2007.css") %>';
 
                        var cssFileAbsPaths = new Array();
                        cssFileAbsPaths[0] = gridSkinUrl
 
                        var grid = $find(gridId);
                         
                         
                        var previewWnd = window.open('about:blank', '', '', false);
 
                        var titleContent = "";
 
                        var now = new Date();
                        var month = convertMonth(now.getMonth());
                        var year = now.getYear();
                        var day = convertDay(now.getDay());
                        var date = now.getDate();
 
                        if (year < 1900) {
                            year = year + 1900;
                        }
 
 
                        if (title != '' && title != null) {
                            title = "<h3>" + title + "</h3>";
                            title = title + "<h4>" + now + "</h4>"
                        }
                         
                        var sh = gridSkinUrl;
                        var styleStr = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd'><html><head><link href = '" + sh + "' rel='stylesheet' type='text/css' /><style type='text/css'>#" + gridId + "_GridData{overflow:visible !important;height:auto !important;}#" + gridId + "_GridHeader{margin:0 !important;padding:0 !important;}</style></head>";
 
                         
                        var oldWidth = grid.get_element().style.width;
                        grid.get_element().style.width = "1600px";
                         
                         grid.repaint();
                         
                         
                        var htmlcontent = styleStr + "<body>" + title + getOuterHTML(grid.get_element()) + "</body></html>";
                         
                        previewWnd.document.open();
                        previewWnd.document.write(htmlcontent);
                        previewWnd.document.close();
                        previewWnd.print();
                        previewWnd.close();
                        grid.get_element().style.width = oldWidth;
                        grid.repaint();
                    }

this code throws the following javascript error in the fitst grid.repaint call:

Error: a[d].get_visible is not a function
Source File: ... ScriptResource.axd?d=PMhSbZd4iWjAxW-377wkUucv5L09yl93HYRXst_WKFB1-uhRhzfg5dYBQCPA8hiLxvQOF664E5-YCNYcSwPKCq142GjPqfZDK724uRg3WT2J7bwnWSYBMtUmFVziVGmJEiV68g2&t=4d9f8e87
Line: 1651

and it references the web resource line:

for(var d in a){if(!a[d].get_visible()){this._owner.get_masterTableView().showColumn(d);

i'm not sure if this is a broken change from upgrading to Q3 2011 or not. Can you tel lme what modificaiton is necessary?

0
Milena
Telerik team
answered on 23 Dec 2011, 02:43 PM
Hello,

I was not able to reproduce the described issue based on the provided information. Could you please open a support ticket and send us a small working project? Thus we will be able to debug it locally and will get back to you with our findings.

I am looking forward your reply.

All the best,
Milena
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Anon
Top achievements
Rank 1
answered on 24 May 2012, 02:13 PM
My post may help with the 'a[d].get_visible is not a function' error.
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 24 May 2012, 02:24 PM
Yes, thanks again for reply. We'll see what Telerik has to say about your suggestion in the other thread.
0
Milena
Telerik team
answered on 29 May 2012, 11:21 AM
Hello,

On the base of the provided information in Anon`s post, we investigated the issue and confirmed that this is a bug. We will log it and our dev team will ensure a proper fix for the next major release.

Regards,
Milena
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Milena
Telerik team
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Anon
Top achievements
Rank 1
Share this question
or