Chart Edit Native/Save event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Gabriel
Newbie
Newbie
Posts: 5
Joined: Fri Feb 26, 2010 12:00 am

Chart Edit Native/Save event

Post by Gabriel » Mon Mar 01, 2010 9:20 am

Hi,
I need to be able to programmatically pick-up the name of the .ten format file created through the Native/Save tab/button in the Chart Editor. That is, I want to use the Native/Save existing feature but to be able in my code (where I create and launch the Editor instance) to handle the saved file name.
Also, in case the user forgets to save his work in Editor, I want to be able to propose to save it during the "CloseForm" button event. I've tested the access to this event, that works, but what is the method to execute for saving in native (.ten) format programmatically?
Thanks!

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Chart Edit Native/Save event

Post by Sandra » Wed Mar 03, 2010 10:52 am

Hello Gabriel,
I need to be able to programmatically pick-up the name of the .ten format file created through the Native/Save tab/button in the Chart Editor. That is, I want to use the Native/Save existing feature but to be able in my code (where I create and launch the Editor instance) to handle the saved file name.
I am sorry, but actually is not possible pick-up the name of files using Chart Editor with last version of TeeChart.Net. I have added your suggestion in wish-list with number [TF02014701] to be considered for inclusion in future releases.

Also, I recommend that use SaveFileDialog for save file name. You could use a similar code as next:

Code: Select all

        string nameChart;
        private void InitializeChart()
        {
            Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar.FillSampleValues();
           
        }
        private void button1_Click(object sender, EventArgs e)
        {
            saveFileDialog1.Filter = "TenFile (.ten)|*.ten"; 
            saveFileDialog1.ShowDialog();
            if (saveFileDialog1.FileName != "")
            {
                tChart1.Export.Template.IncludeData = true;
                tChart1.Export.Template.Save(saveFileDialog1.FileName);
                nameChart = saveFileDialog1.FileName;
            }
        }
Also, in case the user forgets to save his work in Editor, I want to be able to propose to save it during the "CloseForm" button event. I've tested the access to this event, that works, but what is the method to execute for saving in native (.ten) format programmatically?
Please, see TeeChart .Net Pro Tutorials Tutorial12 - Exporting and Importing Charts concretely TeeChart's 'Ten' template and data export/import format .

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / 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

Gabriel
Newbie
Newbie
Posts: 5
Joined: Fri Feb 26, 2010 12:00 am

Re: Chart Edit Native/Save event

Post by Gabriel » Wed Mar 03, 2010 11:44 am

Thanks Sandra.
As I said in my initial post, the way around is that I've coded a mandatory SaveFileDialog in the Close_Editor event. But I thought it would be good that you guys take into account of exposing an event for that button that you already have.

Also, I've spotted that if I try to export the created chart in .ten format (it is proposed on the list), but with an image-type file format highlighted (thus selected) on the textbox, I get a .net error window. This is normal, but:
- think about removing from the SaveFileDialog filter the .ten type in this case.
- better, implement in your code a try/catch rather than leaving the .net exception window to pop-up.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Chart Edit Native/Save event

Post by Yeray » Fri Mar 05, 2010 2:59 pm

Hi Gabriel,
Gabriel wrote:Also, I've spotted that if I try to export the created chart in .ten format (it is proposed on the list), but with an image-type file format highlighted (thus selected) on the textbox, I get a .net error window. This is normal, but:
- think about removing from the SaveFileDialog filter the .ten type in this case.
- better, implement in your code a try/catch rather than leaving the .net exception window to pop-up.
I've added it to the wish list to be enhanced for future releases (TF02014714).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply