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

how to create event OnClientSeriesClicked for dynamically generated radhtmlchart

1 Answer 207 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
avinash
Top achievements
Rank 1
avinash asked on 18 Apr 2014, 07:18 AM
Hi,

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();
               StyleChart();
               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");

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 22 Apr 2014, 12:47 PM
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.

Regards,
Danail Vasilev
Telerik
 

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.

 
Tags
Chart (Obsolete)
Asked by
avinash
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or