You can add importing and exporting functionality to your scheduling application using the Import and Export methods. The Import method opens the OpenFileDialog dialog box, allowing you to import an XML or iCal file. The Export method opens the SaveFileDialog dialog box, allowing you to export an XML or iCal file. Additionally, you can manually select or enter *.dat format to open or save files from OpenFileDialog or SaveFileDialog dialog boxes.
In the following example, C1Calendar and C1Schedule controls are added to the form along with two buttons named Import and Export. When the application is run, you'll be able to import and export data into the C1Schedule control.
Complete the following steps to add importing and exporting functionality to a scheduling application:
The below image illustrates the sample layout of the form after placing all the controls:
C# |
Copy Code
|
---|---|
private void buttonImport_Click(object sender, EventArgs e) { c1Schedule1.Import("Import a File"); } |
C# |
Copy Code
|
---|---|
private void buttonExport_Click(object sender, EventArgs e) { c1Schedule1.Export("", "Export a File"); } |
The Import and Export buttons will enable you to import and export appointments into your scheduling application. To Import and Export appointments from the application, perform the following tasks: