how to create event OnClientSeriesClicked for dynamically generated radhtmlchart

Thread is closed for posting
2 posts, 0 answers
  1. avinash
    avinash  avatar
    9 posts
    Member since:
    Apr 2014

    Posted 18 Apr 2014 Link to this post


    i have created a radhtmlchart dynamically using c# code , now i want to create OnClientSeriesClicked event for this chart and through this event i want to call a java script function ,
    what i am doing is that i am creating radhtmlchart using c# code and adding it to panel, this i have achived so far but now i want that when we click on the series of the chart some java scrip funtion should fire, i am not getting clear idea how to achive this .

    till now what i have done is below (just a refernce).
    create chart()
      RadHtmlChart1 = new RadHtmlChart();
                   RadHtmlChart1.OnClientSeriesClicked += new EventHandler(this.SeriesClicked);
    panel p = new panel();
    p.controls.add(RadHtmlChart1 )

       private void SeriesClicked(object sender, EventArgs e)
             ClientScript.RegisterStartupScript(this.GetType(), "print", "<script>RadHtmlChart1_SeriesClicked();</script>");

    but i am getting a runtime exception if iam doing this way ("Microsoft JScript runtime error: 'System' is undefined");
  2. Danail Vasilev
    Danail Vasilev avatar
    1502 posts

    Posted 22 Apr 2014 Link to this post

    Hello Avinash ,

    The RadHtmlChart renders entirely on the client and therefore it doesn't have server-side click event. More information on the matter is available in Known Limitations help article.

    What I can suggest in order to emulate a server-side click is that you handle the client-side click event of the chart where you can trigger an ajax request or a server-side click of a hidden button. Such an example is illustrated in this online demo.

    Danail Vasilev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top