Fixed Header Extender for GridView in ASP.Net

It always seems like there is an endless supply of reports/tables that need to be created. And one of the requests that comes up with them is to make the headers freeze so you can scroll the rest of the information. It's fairly easy to do, just add a div around the table with a set height and overflow set to auto, set the header of the table to relative positioning, and you're done. However, if you've tried this with a Gridview, you'll notice that it gets a bit annoying. It's doable, but it's a bit annoying. So to help out, I created an extender that sets everything up for me:

FixedHeaderExtender.zip (1.54 kb)

It's pretty basic and very similar to the other extenders (uses the AJAX Toolkit, etc.). All you need to do is set the target control to the GridView and set the height that you want the grid to be. You can still format everything the way that you have in the past, etc. and it doesn't change anything along those lines. All that it does is freezes the headers and allows the other items to scroll. So definitely give it a try, leave feedback, and happy coding.

kick it on DotNetKicks.com   Shout it
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkListEmail

Posted by: James Craig
Posted on: 11/5/2008 at 12:48 PM
Tags: , ,
Categories: AJAX | ASP.Net | Web Design
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading