Copy and Paste Radchart

Thread is closed for posting
2 posts, 0 answers
  1. Palaniappan
    Palaniappan avatar
    8 posts
    Member since:
    Jan 2013

    Posted 19 Jun 2013 Link to this post

    Hi,

       I have already sent mail regarding Rad chart copy and paste option code. But you do not reply me.  Can you reply me for Rad chart copy and paste option client side code?

    Regards
    Palaniappan R
  2. Rosko
    Admin
    Rosko avatar
    137 posts

    Posted 24 Jun 2013 Link to this post

    Hello,

    The following approach works only with IE:
    <div>
            <asp:ScriptManager ID="ScriptManager" runat="server" />
            <telerik:RadChart ID="RadChart1" runat="server">
                <ClientSettings ScrollMode="Both" />
                <Series>
                    <telerik:ChartSeries Name="Sales">
                        <items>
                            <telerik:ChartSeriesItem YValue="34">
                                <Label><TextBlock Text="Internet"></TextBlock></Label>
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="66">
                                <Label><TextBlock Text="Wholesale"></TextBlock></Label>
                            </telerik:ChartSeriesItem>
                            <telerik:ChartSeriesItem YValue="27">
                                <Label><TextBlock Text="Retail"></TextBlock></Label>
                            </telerik:ChartSeriesItem>
                        </items>
                    </telerik:ChartSeries>
                </Series>
            </telerik:RadChart>
            <asp:Button runat="server" Text="Reset" ID="ResetZoom"  OnClientClick="copyImage();" />
            <script type="text/javascript">
                function copyImage() {
                    var HeaderImage = document.getElementById('RadChart1');
                    var controlRange;
                    if (document.body.createControlRange) {
                        controlRange = document.body.createControlRange();
                        controlRange.addElement(HeaderImage);
                        controlRange.execCommand('Copy');
                    }
                    return false;
                }
            </script>
        </div>


    After some research, it can be concluded that there is no easy way to achieve this for all browsers. You will need some third party plugin/library to achieve the desired effect. It is not specific to the control but to the web  technology that is used.

    Regards,
    Rosko
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top