.NET Zone is brought to you in partnership with:

I am developer and technology maniac who is working on Microsoft and PHP technologies. I have ASP.NET MVP title and I hold MCAD, MCSD and MCTS certificates. When I have free time I usually play with new technologies, hack something, read books, participate in communities and speak in events. I am also active blogger and my ASP.NET blog is the place you can find some interesting reading about my discoveries and personal thoughts. Gunnar is a DZone MVB and is not an employee of DZone and has posted 140 posts at DZone. You can read more from them at their website. View Full User Profile

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

06.25.2013
| 2678 views |
  • submit to reddit

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.

Related Posts

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 Gunnar Peipman, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)