Monday, December 05, 2005

Christmas Calendar 5/24

A quick one today:

If you want controls in datagrids to be available in the viewstate, they must be declared and initialised within the page_init. If you want access to calculated values in the footer of a datagrid, you need to make sure the controls containing those values are initialised in page_init or you're screwed.

This is a result of the TrackViewState method on DataGrids being called just before the Load event is fired. The TrackViewState method does exactly what you would expect, it tracks the viewstate, ie. it puts all its controls into the ViewState

No comments: