# Import

## Content



GanttView not only lets you save the project schedules but also lets you load them from XML files and MS Projects. Loading the saved layouts also helps in reducing your time and effort in re-creating the same structure.

### Import from XML

To load project schedules from an XML document, you can simply call [LoadXml](/componentone/api/wpf/online-ganttview/dotnet-api/C1.WPF.GanttView/C1.WPF.GanttView.C1GanttView.LoadXml.html) method of the <span data-popup-content="This class is available in \u003ca href=\u0022/componentone/api/wpf/online-ganttview/dotnet-api/C1.WPF.GanttView/C1.WPF.GanttView.C1GanttView.html\u0022\u003e.NET\u003c/a\u003e and \u003ca href=\u0022/componentone/api/wpf/online-ganttview/dotnet-api/C1.WPF.GanttView/C1.WPF.GanttView.C1GanttView.html\u0022\u003e.NET Framework\u003c/a\u003e." data-popup-title="C1GanttView" data-popup-theme="ui-tooltip-green qtip-green">C1GanttView</span> class and parse name of the XML document as a parameter.

Use the code below to load contents from an XML document.

```csharp
//import content from gantt.xml file
if (File.Exists("gantt.xml"))
{
    gv.LoadXml("gantt.xml");
}       
```

### Import from MS Project

The GanttView control supports importing MS Project XML to GanttView by using [ImportFromMsProjectXml](/componentone/api/wpf/online-ganttview/dotnet-api/C1.WPF.GanttView/C1.WPF.GanttView.C1GanttView.ImportFromMsProjectXml.html) method of the **C1GanttView** class. The **ImportFromMsProjectXml** method takes the file name as its parameter and imports it.

The following code imports the project schedules from an MS project.

```csharp
//import content from ganttMSProject.xml file
if (File.Exists("ganttMSProject.xml"))
{
    gv.ImportFromMsProjectXml("ganttMSProject.xml");
}
```