Click events for dynamically generated chart not fire ?

Posted by Nisar under ASP.NET on 8/2/2010 | Views : 4630 | Status : [Member] | Replies : 2
Hi I am creating dundas chart at run time and i want to capture click event of chart.

I tried this but it do not work

chart.Click += new ImageMapEventHandler(chart_Click);

protected void chart_Click(object sender, ImageMapEventArgs e)
{
Label1.Text = "Clicked!!!";
}


Can any body help me please.

Thanks




Responses

Posted by: Vuyiswamb on: 8/2/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Does the Dundas chat have a Click event?

Thank you for posting at Dotnetfunda
[Administrator]

Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nisar on: 8/3/2010 [Member] Starter

Up
0
Down
Hi,

I create chart dynamically, I want to double click on chart and popup a new window on double click on chart.

One way i captured the click event but when i click , it alwas go busy

Any solution please?

Here is my code

void CreateChart2(System.Data.DataRow MyRow,int no)
{
Chart chart1 = new Chart();
chart1.ImageUrl = "~/TempFiles/ChartPic_#SEQ(100,3)";
chart1.ID = "chart" + no.ToString();
chart1.Click += new ImageClickEventHandler(Chart1_Click1); // In debug it always remains in this block ( CreateChart2)
ChartArea chartArea1 = new ChartArea();
Legend legend1 = new Legend();
Series series1 = new Series();
.......................
...................
}
protected void chart_Click(object sender, ImageMapEventArgs e)
{
Label1.Text = "Clicked!!!";
}

Thanks



Nisar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response