Updated Code: Freeze the Header, Scroll the Grid
If you downloaded the source code for this aspnetPRO Magazine article, you probably missed the source code of the custom control the article is all about. In this case, retry today and get the correct ZIP.
The article discusses how to build an automatic, self-contained mechanism to make a grid of data scroll within a browser. Basically, I'll accomplish it by extending the DataGrid control to support scrollable areas while preserving the same capabilities and programming facilities for the base class.
To make the content of a Web control scroll, you simply have to wrap it in a
tag, assign an explicit
height to the block, and set the
overflow CSS attribute to auto. For a
DataGrid, in particular, this poses the problem of the header and the footer. (The pager is reasonably set aside because you don't want a pager if you scroll the grid.) Unless ad hoc measures are taken, the header and the footer will scroll with the rest of the grid. To make it short, to obtain what's in the figure below you need some extra work. (Which can be tricky and challenging.)
Note that in order to read the article you need a subscription to the aspnetPRO Magazine and must enter your subscriber ID.