I have a problem to get Click-event to work when creating shape series dynamically. When I'm using editor to create new one, then shape_Click - event works.
Here's the sample code, any ideas?
public class Form2 : System.Windows.Forms.Form
{
private Steema.TeeChart.Styles.Shape shape;
.
.
.
// create new shape
private void button2_Click(object sender, System.EventArgs e)
{
shape = new Steema.TeeChart.Styles.Shape();
tChart1.Series.Add(shape);
shape.X0 = 4;
shape.X1 = 9;
shape.Y0 = 5;
shape.Y1 = 12;
shape.Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle;
shape.Transparent=false;
shape.Pen.Color=Color.Blue;
shape.Pen.Width=2;
shape.Brush.Color=Color.Blue;
shape.Font.Size=1;
shape.Click += new System.Windows.Forms.MouseEventHandler(this.shape_Click);
}
public void shape_Click(object sender, System.Windows.Forms.MouseEventArgs e)
{
MessageBox.Show("Shape clicked");
}
Shape_Click() events
Yes, this is a known bug (already added on our defect list), it sonly happens using the Rectanlgle style. We'll try to fix if for the next maintenance releases.
Josep Lluis Jorge
http://support.steema.com
Josep Lluis Jorge
http://support.steema.com
Hello,
Does it mean that every runtime interactive events that respond to user mouseclicks will not work in TeeChart Pro.NET ?
My WebChart is PostBack.
I tried to make events with mouse, like ClickBackground, ClickSeries, ClickTitle. The mouse cursor is a hand (means there is a link).
My WebChart is printed and filled with data in it but when I click, I just get a postback (refresh browser) with same data. My events are simple :
private void WebChart1_ClickTitle(object sender, System.Web.UI.ImageClickEventArgs e)
{
txtMessage.Text = "Test!";
}
I know that the program doesn't enter in this function (I set breakpoint).
Is it normal that events don't work or there is something I missed ?
Thank you,
Simon
Does it mean that every runtime interactive events that respond to user mouseclicks will not work in TeeChart Pro.NET ?
My WebChart is PostBack.
I tried to make events with mouse, like ClickBackground, ClickSeries, ClickTitle. The mouse cursor is a hand (means there is a link).
My WebChart is printed and filled with data in it but when I click, I just get a postback (refresh browser) with same data. My events are simple :
private void WebChart1_ClickTitle(object sender, System.Web.UI.ImageClickEventArgs e)
{
txtMessage.Text = "Test!";
}
I know that the program doesn't enter in this function (I set breakpoint).
Is it normal that events don't work or there is something I missed ?
Thank you,
Simon
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi Simon,
Have you tried running the ASP.NET example under:
C:\Program Files\Steema Software\TeeChart for .NET v1\TeeChartForNET\WebForm ?
Try creating a C# ASP.NET project on your machine and copying all the *.aspx.* files across to it.
Now change part of the Page_Load() method so it looks like this:
Now cut the following line from the InitializeComponent() method:
And paste it into the beginning of the Page_Load function ... this seems to work OK here. Does it work OK at your end?
Have you tried running the ASP.NET example under:
C:\Program Files\Steema Software\TeeChart for .NET v1\TeeChartForNET\WebForm ?
Try creating a C# ASP.NET project on your machine and copying all the *.aspx.* files across to it.
Now change part of the Page_Load() method so it looks like this:
Code: Select all
//setup Chart
if (ch1.Series.Count<2)
{
ch1.Series.Add(new Steema.TeeChart.Styles.Points());
ch1.Series.Add(new Steema.TeeChart.Styles.Shape());
}
ch1.Header.Text="Chart 1. Click on Points of this Chart to see event demo.";
ch1.Series[0].FillSampleValues(5);
ch1.Series[1].FillSampleValues(1);
Code: Select all
this.WebChart1.ClickSeries += new Steema.TeeChart.Web.WebChart.SeriesEventHandler(this.WebChart1_ClickSeries);
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/