



















Blogger Templates
3-Column Animals Architecture Art Beta (Google account) Cars, Ships & Airplanes Cartoon And Kids Classic Computers Country and City (new) Game General Music and Dance Nature Simple (new) Sports Women Religion Index
The GridView control is often used to display tabular data, much like an Excel spreadsheet. However, unlike Excel, the GridView control doesn't have any automatic way of locking the header row so that it doesn't scroll out of view.
Check out this example of a GridView within a DIV with the overflow-Y property set to scroll. Notice that as you scroll the GridView, the header row scrolls out of view. It would be more convenient to have a locked header row so that the header row is always visible regardless of the scoll position of the GridView. It would also be nice to have a header row that dynamically configured itself as per the data source so that if we add a new field to the GridView, a corresponding column automatically gets added to the locked header row.
Here's another example, but this time, the header row stays locked at the top of the GridView so that you can scroll without losing track of column names. There are a few steps required to implement this functionality.
Let's go through each of these steps. (If you'd prefer to work with a working project, you can download the project at the end of this post.)
Back to TOP