I am using TeeChart for ASP .NET.
By default I am able to disable single clicks on my chart by setting NoClickPostback to true.
I have a callback function(ASP:button) through which I try to set NoClickPostback to false, so that single clicks are enabled again. But they are not getting enabled again.
In short,
If I set NoClickPostback to true in the beginning, I am never able to enable single clicks again. In the same way, If I set NoClickPostback to false in the beginning, I am never able to disable single clicks.
thanks
Jagadish
unable to change NoClickPostback property after first time
Re: unable to change NoClickPostback property after first time
Hello Jagadish,
Using next code where disable or enable AutoPostBack, when you clicks a button:
Could you tell us if previous code works as you expected?
Thanks,
Using next code where disable or enable AutoPostBack, when you clicks a button:
Code: Select all
protected void InitializeChart()
{
Steema.TeeChart.Chart ch1;
tmpChart = new System.IO.MemoryStream();
if (Session["ch1"] == null)
{
ch1 = WebChart1.Chart;
ch1.Aspect.View3D = false;
Series1 = new Steema.TeeChart.Styles.Line(ch1);
Series1.FillSampleValues();
Button1.Click += new EventHandler(Button1_Click);
ch1.Export.Template.Save(tmpChart);
//save template to a Session variable
Session.Add("ch1", tmpChart);
}
else
{
//retrieve the session stored Chart
tmpChart = (System.IO.MemoryStream)Session["ch1"];
//set the Stream position to 0 as the last read/write
//will have moved the position to the end of the stream
tmpChart.Position = 0;
//import saved Chart
WebChart1.Chart.Import.Template.Load(tmpChart);
Button1.Click += new EventHandler(Button1_Click);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
WebChart1.AutoPostback = !WebChart1.AutoPostback;
if (WebChart1.AutoPostback)
{
WebChart1.Chart.Header.Text = "Hello";
}
else
{
WebChart1.Chart.Header.Text = "Good bye";
}
}
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: unable to change NoClickPostback property after first time
Hi Sandra
Both methods work now. The problem was in the AJAX sript I was using. Thanks for the help.
-Jagadish
Both methods work now. The problem was in the AJAX sript I was using. Thanks for the help.
-Jagadish