I've developed a data form web part in SharePoint Designer 2010. The web part present a filtered view of a list along with edit and insert functions. I want to move the code out to Visual Studio into a solution I have for all our SP enhancements.
I exported the web part to a .webpart file from SP Designer and used that as the .webpart in a visual web part project, but when I deploy the project, the web part from Visual Studio doesn't have any data in it. The same web part deployed from SP Designer does have data in it.
I tried changing the VS web part .cs class to inherit from Microsoft.SharePoint.WebPartPages.DataFormWebPart, but that didn't fix the problem. Here's the .webpart file, any help is appreciated:
<?xml version="1.0" encoding="utf-8"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="PipelineItemEditor.VisualWebPart1.VisualWebPart1, $SharePoint.Project.AssemblyFullName$" />
<importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
</metaData>
<data>
<properties>
<property name="InitialAsyncDataFetch" type="bool">False</property>
<property name="ChromeType" type="chrometype">TitleOnly</property>
<property name="Title" type="string">My Pipeline Items</property>
<property name="Height" type="string" />
<property name="CacheXslStorage" type="bool">True</property>
<property name="ListDisplayName" type="string" null="true" />
<property name="AllowZoneChange" type="bool">False</property>
<property name="AllowEdit" type="bool">False</property>
<property name="XmlDefinitionLink" type="string" />
<property name="DataFields" type="string" />
<property name="Hidden" type="bool">False</property>
<property name="ListName" type="string" null="true" />
<property name="NoDefaultStyle" type="string">TRUE</property>
<property name="AutoRefresh" type="bool">True</property>
<property name="ViewFlag" type="string">8388621</property>
<property name="Direction" type="direction">NotSet</property>
<property name="AutoRefreshInterval" type="int">60</property>
<property name="AllowConnect" type="bool">False</property>
<property name="Description" type="string" />
<property name="AllowClose" type="bool">False</property>
<property name="ShowWithSampleData" type="bool">False</property>
<property name="ParameterBindings" type="string">
<ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
<ParameterBinding Name="OpenMenuKeyAccessible" Location="Resource(wss,OpenMenuKeyAccessible)"/>
<ParameterBinding Name="open_menu" Location="Resource(wss,open_menu)"/>
<ParameterBinding Name="select_deselect_all" Location="Resource(wss,select_deselect_all)"/>
<ParameterBinding Name="idPresEnabled" Location="Resource(wss,idPresEnabled)"/>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)"/>
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(core,noXinviewofY_DEFAULT)"/>
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)"/>
<ParameterBinding Name="MoreAnnouncements" Location="Resource(wss,moreItemsParen)"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/>
</property>
<property name="Xsl" type="string" null="true" />
<property name="CacheXslTimeOut" type="int">86400</property>
<property name="WebId" type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">00000000-0000-0000-0000-000000000000</property>
<property name="ListUrl" type="string">Lists/Pipeline</property>
<property name="DataSourceID" type="string" />
<property name="FireInitialRow" type="bool">True</property>
<property name="ManualRefresh" type="bool">False</property>
<property name="ViewFlags" type="Microsoft.SharePoint.SPViewFlags, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Html, TabularView, Hidden, Mobile</property>
<property name="ChromeState" type="chromestate">Normal</property>
<property name="AllowHide" type="bool">False</property>
<property name="PageSize" type="int">-1</property>
<property name="SampleData" type="string" null="true" />
<property name="BaseXsltHashKey" type="string" null="true" />
<property name="AsyncRefresh" type="bool">True</property>
<property name="HelpMode" type="helpmode">Modeless</property>
<property name="ListId" type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">00000000-0000-0000-0000-000000000000</property>
<property name="DataSourceMode" type="Microsoft.SharePoint.WebControls.SPDataSourceMode, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">List</property>
<property name="AllowMinimize" type="bool">False</property>
<property name="TitleUrl" type="string">/Lists/Pipeline</property>
<property name="CatalogIconImageUrl" type="string" />
<property name="DataSourcesString" type="string" />
<property name="GhostedXslLink" type="string">main.xsl</property>
<property name="PageType" type="Microsoft.SharePoint.PAGETYPE, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">PAGE_NORMALVIEW</property>
<property name="DisplayName" type="string">All Pipeline Items</property>
<property name="UseSQLDataSourcePaging" type="bool">True</property>
<property name="Width" type="string" />
<property name="ExportMode" type="exportmode">All</property>
<property name="XslLink" type="string" null="true" />
<property name="ViewContentTypeId" type="string">0x</property>
<property name="HelpUrl" type="string" />
<property name="XmlDefinition" type="string">
<View Name="{2F369D62-EFD0-4E6F-961D-BA71E4622076}" MobileView="TRUE" Type="HTML" Hidden="TRUE" DisplayName="All Pipeline Items" Url="/SitePages/pipelinetest.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/generic.png">
<Query>
<Where>
<Eq>
<FieldRef Name="Author"/>
<Value Type="Integer">
<UserID/>
</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name="Created_x0020_Date" Ascending="FALSE"/>
</OrderBy>
<GroupBy>
</GroupBy>
</Query>
<ViewFields>
<FieldRef Name="Edit"/>
<FieldRef Name="PItemType"/>
<FieldRef Name="PItemText"/>
<FieldRef Name="PItemLink"/>
<FieldRef Name="PItemDirection"/>
<FieldRef Name="PItemPicture"/>
<FieldRef Name="Created"/>
<FieldRef Name="Related_x0020_Tags"/>
</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<Toolbar Type="Standard"/>
<ViewStyle ID="17"/>
</View>
</property>
<property name="Default" type="string">FALSE</property>
<property name="TitleIconImageUrl" type="string" />
<property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
<property name="SelectParameters" type="string" />
</properties>
</data>
</webPart>
</webParts>