Option (a) buy into a UI package that includes a souped-up GridView with this functionality built-in.
Option (b) roll your own - it's not simple. Dino Esposito http://weblogs.asp.net/despos/archive/2003/12/12/43091.aspx.
EDIT: Just noticed that the Dino article links to a subscriber-only area on the ASPnetPro magazine site.
Here's http://weblogs.asp.net/dwahlin/archive/2007/07/31/freeze-asp-net-gridview-headers-by-creating-client-side-extenders.aspx using extenders.
or check this,