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 a XML, iCal, or binary (.dat) file. The Export method opens the SaveFileDialog dialog box allowing you to export a XML, iCal, or binary (.dat) file.
In the following example, C1Calendar and C1Schedule controls are added to the form along with Import and Export buttons. 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:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click C1Schedule1.Import("Import a File") End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void button1_Click(object sender, EventArgs e) { c1Schedule1.Import("Import a File"); } |
This will enable importing files.
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click C1Schedule1.Export("", "Export a File") End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void button2_Click(object sender, EventArgs e) { c1Schedule1.Export("", "Export a File"); } |
This will enable exporting files.
The Import and Export buttons will enable you to import and export appointments into your scheduling application.