GanttView for WPF | ComponentOne
Export and Import / Import
In This Topic
    Import
    In This Topic

    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 method of the C1GanttView class and parse name of the XML document as a parameter.

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

    C#
    Copy Code
    //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 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.

    C#
    Copy Code
    //import content from ganttMSProject.xml file
    if (File.Exists("ganttMSProject.xml"))
    {
        gv.ImportFromMsProjectXml("ganttMSProject.xml");
    }