Only the last series triggers the Click event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Alan
Newbie
Newbie
Posts: 3
Joined: Sat Oct 04, 2003 4:00 am

Only the last series triggers the Click event

Post by Alan » Tue Jan 23, 2007 2:53 pm

I want to make my application respond to clicks on the series in the chart.
I have made event handlers like this

foreach (Steema.TeeChart.Styles.Series S in this.Chart.Series)
S.Click +=new MouseEventHandler(S_Click);

but when I click on the series, the S_Click() method is never called, except from when clicking on the last added series.

Am I doing something wrong here?

Thanks

Alan

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jan 23, 2007 3:08 pm

Hi Alan,

It works fine for me here using the latest TeeChart for .NET v2 maintenance release and this code:

Code: Select all

		private void Form1_Load(object sender, EventArgs e)
		{
			for (int i = 0; i < 5; i++)
			{
				tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
			}

			foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
			{
				s.FillSampleValues();
				s.Click += new MouseEventHandler(s_Click);
			}

		}

		void s_Click(object sender, MouseEventArgs e)
		{
			Steema.TeeChart.Styles.Series s = (Steema.TeeChart.Styles.Series)sender;

			label1.Text = tChart1.Series.IndexOf(s).ToString();
		}
Which TeeChart version are you using?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Alan
Newbie
Newbie
Posts: 3
Joined: Sat Oct 04, 2003 4:00 am

Post by Alan » Thu Jan 25, 2007 9:13 am

I am using TeeChart for .NET v1

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 25, 2007 9:43 am

Hi Alan,

The code I posted also works fine for me here using the latest TeeChart for .NET v1 release available at the client area. Are you using the latest version available, which is Build 1.1.2531.28391 from 6th December 2006?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Alan
Newbie
Newbie
Posts: 3
Joined: Sat Oct 04, 2003 4:00 am

Post by Alan » Thu Jan 25, 2007 1:19 pm

I have installed the latest build 1.1.2531.28391, but still, only clicks on the last serie who get the handle added, do trigger the handle.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 25, 2007 1:51 pm

Hi Alan,

Have you tried running the example I posted? Does it work at your end? If the problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.

You can post your files either at news://www.steema.net/steema.public.attachments newsgroup or at our download page at http://www.steema.net/upload/.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply