Would it be possible to see an example of C# code using the Chart Editor's CloseEditor event?
I maintain a DataGrid which shows the chart series, along with names of the objects that will provide data for each Series.
If a user opens the chart editor and adds a Series, and then closes the editor, I am planning on using the CloseEditor event to re-scan the Series in the chart and update my DataGrid accordingly.
Thanks for your time!
Marc.
Example with CloseEditor event
-
- Newbie
- Posts: 14
- Joined: Mon Sep 12, 2011 12:00 am
Re: Example with CloseEditor event
Answering my own question, although it doesn' t work if user right-clicks on chart and chooses Edit. Only works with custom button where I control how the editor gets called and displayed.
Code: Select all
static void RefreshDataSources(object sender, EventArgs e)
{
MessageBox.Show("in Refresh");
return;
}
private void tspDataSourceNew_Click(object sender, EventArgs e)
{
//Need to maintain which tab is selected.
Steema.TeeChart.TChart tChart = (Steema.TeeChart.TChart)chartBook1.TabPages[0].Controls[0];
Steema.TeeChart.Editor ed = new Steema.TeeChart.Editor(tChart);
ed.CloseEditor += new EventHandler(RefreshDataSources);
ed.ShowModal(this);
}
Re: Example with CloseEditor event
Hello TelventUser,
I not sure understand good what you refer when you talk about "right-clicks on chart and chooses Edit" and we would be very grateful if you can better explain as you want achieve.
On the other hand, I can not reproduce your problem, when you click with right button on the Chart. I have used next simple code:
Can you please,check if previous code works as you expected?
Thanks,
I not sure understand good what you refer when you talk about "right-clicks on chart and chooses Edit" and we would be very grateful if you can better explain as you want achieve.
On the other hand, I can not reproduce your problem, when you click with right button on the Chart. I have used next simple code:
Code: Select all
Steema.TeeChart.Styles.Line line1;
private void InitializeChart()
{
line1 = new Line(tChart2.Chart);
line1.FillSampleValues();
tChart2.Click += new EventHandler(tChart2_Click);
}
void tChart2_Click(object sender, EventArgs e)
{
Steema.TeeChart.Editor ed = new Steema.TeeChart.Editor();
ed.Chart = tChart2;
ed.CloseEditor += new EventHandler(ed_CloseEditor);
ed.ShowModal(this);
}
void ed_CloseEditor(object sender, EventArgs e)
{
MessageBox.Show("in Refresh");
return;
}
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 |