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

print pane page style not apply

1 Answer 40 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
maduka
Top achievements
Rank 2
maduka asked on 28 Jun 2010, 05:33 AM
this my html code
<telerik:RadSplitter id="RadSplitter1" runat="server" height="200"
 <telerik:RadPane id="InternalContentPane" runat="server" width="120"
 <Telerik:RadMenu ID="mBar0" Runat="server" Skin="Office2007" Width="100%"
       <CollapseAnimation Duration="200" Type="OutQuint" /> 
       <Items> 
           <Telerik:RadMenuItem runat="server" Text="Root RadMenuItem1"
           </Telerik:RadMenuItem> 
           <Telerik:RadMenuItem runat="server" Text="Root RadMenuItem2"
               <Items> 
                   <Telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1"
                       <Items> 
                           <Telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1"
                           </Telerik:RadMenuItem> 
                       </Items> 
                   </Telerik:RadMenuItem> 
                   <Telerik:RadMenuItem runat="server" Text="Child RadMenuItem 2"
                   </Telerik:RadMenuItem> 
               </Items> 
           </Telerik:RadMenuItem> 
           <Telerik:RadMenuItem runat="server" Text="Root RadMenuItem3"
           </Telerik:RadMenuItem> 
           <Telerik:RadMenuItem runat="server" Text="Root RadMenuItem4"
           </Telerik:RadMenuItem> 
           <Telerik:RadMenuItem runat="server" Text="Root RadMenuItem5"
           </Telerik:RadMenuItem> 
           <Telerik:RadMenuItem runat="server" Text="Root RadMenuItem6"
           </Telerik:RadMenuItem> 
       </Items> 
       </Telerik:RadMenu> 
   <p> 
    
       Founded in 2002, Telerik Corporation is a leading vendor of User Interface (UI)  
       components for ASP.NET and Windows Forms. Building on our expertise in interface  
       development and Microsoft technologies, Telerik helps customers build  
       applications with unparalleled richness, responsiveness and interactivity.  
       Created with passion, Telerik products help thousands of developers every day to  
       be more productive and deliver reliable applications under budget and on time. 
       <p> 
       </p> 
   </p> 
 </telerik:RadPane> 
 <telerik:RadSplitBar id="RadSplitbar1" runat="server"/> 
 <telerik:RadPane id="ExternalContentPane" runat="server" width="300" 
    ContentUrl="http://www.yahoo.com.tw" /> 
</telerik:RadSplitter> 
<href="javascript:PrintPane('<%= InternalContentPane.ClientID %>');"
 Print the content of 'Internal Content Pane'</a><br /> 
<href="javascript:PrintPane('<%= ExternalContentPane.ClientID %>');"
 Print the content of 'External Content Pane'</a> 
<script type="text/javascript"
function PrintPane (paneID) 
 var splitter = $find('<%= RadSplitter1.ClientID%>'); 
 var pane = splitter.GetPaneById(paneID); 
 if (!pane) return; 
 var cssFileAbsPath = 'http://localhost/printStyles.css'
 var arrExtStylsheetFiles = [ cssFileAbsPath ]; 
 pane.Print(arrExtStylsheetFiles); 
</script> 

when I print 'Internal Content Pane'
the RadMenu Style will lose
I use ver 2008.02.0826.35 to develop project, and this project scope is very large
I try to upgrade ver 2010, but have some error
How to fix this print problem?

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 30 Jun 2010, 05:42 PM
Hi Maduka,

In order to print CSS decorated content of RadPane you need to provide path to the CSS files. In your scenario you will need to configure the RadMenu to use an external CSS files in order to be able to provide them to the print() method of RadPane.
To do so you need to follow these steps:
  1. Set RadMenu's property EnableEmbeddedSkins to false:
    <Telerik:RadMenu ID="mBar0" Runat="server" Skin="Vista" Width="100%" EnableEmbeddedSkins="false">
  2. Copy the skin related CSS files and images for RadMenu from Skin folder located in the Telerik instalation folder(most often C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX XXXXX\Skins)
  3. Register the RadMenu's CSS files on the page:
    <link href="Skin/Menu.css" rel="stylesheet" type="text/css" />
    <link href="Skin/Vista/Menu.Vista.css" rel="stylesheet" type="text/css" />
  4. Provide the path to these CSS files as an array property to the RadPane's print method:
    function PrintPane(paneID)
    {
        var splitter = $find('<%= RadSplitter1.ClientID%>');
        var pane = splitter.GetPaneById(paneID);
        if (!pane) return;
        var arrExtStylsheetFiles = ['./Skin/Menu.css', "./Skin/Vista/Menu.Vista.css"];
        pane.Print(arrExtStylsheetFiles);
    }

For your convenience I have attached a sample project with the above mentioned implementation.

Greetings,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Splitter
Asked by
maduka
Top achievements
Rank 2
Answers by
Dobromir
Telerik team
Share this question
or