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

Stylesheets

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 05 Aug 2011, 07:25 PM
I'm using your example to print a pane with stylesheets. (http://www.telerik.com/help/aspnet-ajax/splitter-panes-printing.html)

Inside this panel I have several listviews that contain buttons  (Add, Edit and Delete)
I want to supress these buttons when I print.  What do I need to put in the stylesheet to do this?
 

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 10 Aug 2011, 03:26 PM
Hi Dave,

The mentioned help article demonstrates how to add external CSS file to be applied to the content of the pane when printed. In order to hide elements from the page, you can simply set the CSS property display:none to them with the loaded CSS file, e.g.:
CSS File:
.hideWhenPrinting
{
    display:none;
}
ASPX File:
<telerik:RadSplitter ID="RadSplitter1" runat="server" Height="200">
    <telerik:RadPane ID="InternalContentPane" runat="server" Width="120">
        <telerik:RadListView ID="RadListView1" runat="server">
            <ItemTemplate>
                <asp:Button Text="Visible Button" runat="server" />
                <asp:Button Text="Hidden Button" runat="server" CssClass="hideWhenPrinting"/>
            </ItemTemplate>
        </telerik:RadListView>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="RadSplitbar1" runat="server" />
    <telerik:RadPane ID="ExternalContentPane" runat="server" Width="300" ContentUrl="Default.html" />
</telerik:RadSplitter>
<a href="javascript:PrintPane('<%= InternalContentPane.ClientID %>');">Print the content
    of 'Internal Content Pane'</a><br />
<a 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 = './printStyles.css';
        var arrExtStylsheetFiles = [cssFileAbsPath];
        pane.Print(arrExtStylsheetFiles);
    }
</script>

I hope this helps.

Kind regards,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
General Discussions
Asked by
Dave
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or