title: Adding Gantt Chart view to custom list template in XML. <ViewData> not deploying
body: <p>In a Sharpoint 2010 project, I have a custom content type, which inherits the standard Task content type, and a custom list template, with items of this content type (everything is done in XML and code, not 'clicked-through'). </p>
  
  <p>I would like to add a Gantt chart to my list. I can do it using the web interface but I would like to have it in code. So I have done it manually, opened Sharepoint Manager, previewed the view schema and, with minor but necessary modifications, copied it to my list schema. So I ended up with a view which looks more less like this:</p>
  
  <pre><code>  &lt;View WebPartZoneID="Main" Type="GANTT" DisplayName="Gantt Chart" Url="gantt.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/issues.png" SetupPath="pages\viewpage.aspx"&gt;
      &lt;Query&gt;
        &lt;OrderBy&gt;
          &lt;FieldRef Name="ID" /&gt;
        &lt;/OrderBy&gt;
      &lt;/Query&gt;
      &lt;ViewFields&gt;
        &lt;FieldRef Name="Attachments" /&gt;
        &lt;FieldRef Name="ID" /&gt;
        &lt;FieldRef Name="DocIcon" /&gt;
        &lt;FieldRef Name="LinkTitle" /&gt;
        &lt;FieldRef Name="AssignedTo" /&gt;
        &lt;FieldRef Name="Status" /&gt;
        &lt;FieldRef Name="Priority" /&gt;
        &lt;FieldRef Name="StartDate" /&gt;
        &lt;FieldRef Name="DueDate" /&gt;
        &lt;FieldRef Name="MyCustomField" /&gt;
        &lt;!-- other FieldRefs for my custom fields --&gt;
      &lt;/ViewFields&gt;
      &lt;ViewData&gt;
        &lt;FieldRef Name="StartDate" Type="GanttStartDate" /&gt;
        &lt;FieldRef Name="DueDate" Type="GanttEndDate" /&gt;
        &lt;FieldRef Name="Title" Type="GanttTitle" /&gt;
        &lt;FieldRef Name="PercentComplete" Type="GanttPercentComplete" /&gt;
        &lt;FieldRef Name="Predecessors" Type="GanttPredecessors" /&gt;
      &lt;/ViewData&gt;
      &lt;RowLimit Paged="TRUE"&gt;30&lt;/RowLimit&gt;
      &lt;Aggregations Value="Off" /&gt;
    &lt;/View&gt;
  </code></pre>
  
  <p>But this doesn't work. The view is visible on the list, but when I open it, a blank page appears. Because of some reason, when I preview my custom view in Sharepoint Manager the <code>&lt;ViewData&gt;</code> tag is not there. I may add this tag manually in Sharepoint Manager and then the view magically starts to work. However, the tag, because of some reason, is not deployed with the rest of the view. </p>
  
  <p>Any suggestions as to how to make the tag deploy?</p>