Geeks With Blogs
Josh Meyer fun with .Net

I've been banging my head on the desk for several days trying to figure out why the formulas in my FarPoint Spread (an awesome control, by the way) control aren't working and it turns out it has nothing to do with the Spread control at all. 

I was binding my spread control to a DataSet up until a few days ago, when a requirements change caused me to alter the code a bit.  One of the changes I made was to bind to a DataView instead of directly to the DataSet, which I did without giving it another thought.  Well, it turns out that the DataView is NOT serializable, so it can't be saved to viewstate.  So all this time I thought there was a problem with the spread control itself, when actually the spread control was just losing it's datasource between postbacks, and the nature of how the control performs updates kept this seemingly obvious fact hidden from me.  The properties of the spread control, including formulas, were being preserved but the data was not so my formulas all returned 0. 

The fact that the DataView does not serialize is probably well known by now, and I may have even known this at some point in the past, but if I did I forgot it and it has caused my several days of grief.  Maybe I can save someone else a little time with this post.

Posted on Friday, November 28, 2008 9:55 PM Misc .Net | Back to top


Comments on this post: ASP.Net DataView and Viewstate

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Josh Meyer | Powered by: GeeksWithBlogs.net