Platinum Partner
dotnet,how-to,microsoft,tools,sharepoint,web-view

SharePoint 2010 Data Form Web Part can’t render Created Date and throws StackOverflowException

After migrating content database from SharePoint 2007 to SharePoint 2010 one of pages with data form web part gave the following errors: Failed to render Field Created_x0020_Date, use default value insteadand Error while executing web part: System.StackOverflowException: Operation caused a stack overflow. Although I found no simple click-and-save solution to problem there’s still way how to solve the issue bu subclassing Data Form Web Part and overriding some properties. Here’s the solution that worked for me.

For me worked overriding some properties of DataFormWebPart like suggested in Microsoft Support articleSharePoint 2010: DataForm Web Part displays "Unable to display this Web Part".

[ToolboxItemAttribute(false)]
public class DataFormWebPartFix : DataFormWebPart   
{
     public override bool IsGhosted
     {
         get
         {
             return true;
         }
     }
     public override bool CanHaveServerControls
     {
         get
         {
             return true;
         }
     }
}

Weird thing is the fact that page contains teo data form web parts that both gave the same errors but using extended data form web part only with first of them solved the problem also for another.

The post SharePoint 2010 Data Form Web Part can’t render Created Date and throws StackOverflowException appeared first on Gunnar Peipman - Programming Blog.



Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}