Radchart click event

Thread is closed for posting
5 posts, 0 answers
  1. prayag ganoje
    prayag ganoje avatar
    127 posts
    Member since:
    Feb 2010

    Posted 25 Apr 2011 Link to this post

    hello,

    I have few radcharts (Bar, line) and also have implemented a OnClick events for them. These click events are restricted only to the bar (if exists) or active regions in case of line chart.

    I would like to have a click event if I click any where on the chart plotarea and not only the bar or active region in the line chart.

    Can you please suggest me how I can achieve the same ?

    Protected Sub rc_CSMD_Click(sender As Object, args As Telerik.Charting.ChartClickEventArgs) Handles rc_CSMD.Click
                    Response.Redirect("~/Internal/Dashboard/EditReport.aspx)
        End Sub
  2. Missing user
    Missing user avatar

    Posted 28 Apr 2011 Link to this post

    Hello prayag ganoje,

    Presently, RadChart does not support a click method only for PlotArea. However you can add a click method to the generated RadChart image. For example, after the image is generated you can get it by javascript code and add a click event in which you can redirect to another page. Please note that this will make the entire RadChart clickable.

    Kind regards,
    Polina
    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.

  3. prayag ganoje
    prayag ganoje avatar
    127 posts
    Member since:
    Feb 2010

    Posted 01 May 2011 Link to this post

    Hello,

    Can you please provide some code sample for the work around you have suggested ?

    Also is there any KB document on the same ?

  4. prayag ganoje
    prayag ganoje avatar
    127 posts
    Member since:
    Feb 2010

    Posted 04 May 2011 Link to this post

    Hello,

    can you please redirect me to some KB dock if available for this ? Actually I didnot get what you mentioned in your previous reply.
  5. Missing user
    Missing user avatar

    Posted 05 May 2011 Link to this post

    Hello prayag ganoje,

    As I mentioned in the previous post this functionality is not supported in the RadChart by default. You can achieve a similar functionality by making the entire RadChart clickable. One possible workaround is to get the RadChart with javascript and after that redirect to another page. For example:
    markup code
    <script type="text/javascript">
        function MyPageLoaded() {
            var chartDiv = document.getElementById('RadChartId');
            if (chartDiv != null) {
                chartDiv.setAttribute("onclick", "RadChartClick()");
            }
        }
     
        function RadChartClick() {
            location.href = '<%= Page.ResolveUrl("~/MyRedirectPage.aspx") %>';
        }
    </script>
    and set body onload event to MyPageLoaded()
    <body onload="MyPageLoaded()">
    You can also wrap the chart with a link which can achieve the same scenario.

    Best wishes,
    Polina
    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.

Back to Top