In ASP.NET, is there any databound control (GridView, DataList, Repeater, ListView etc.) which has fixed header feature?
I search on net but find complex solutions for this simple requirement. I am wonder How Microsoft forget to give this simple and required feature?
Any way I am working on ASP.NET Framework 3.5. Has somebody find simple solution to this problem yet?
Asked
Active
Viewed 1,262 times
1

Amit
- 21,570
- 27
- 74
- 94
-
I don't understand exactly what you mean by "fixed header". Do you mean that the table header remains visible while the user scrolls down through the table rows? – DOK Apr 01 '12 at 20:11
-
If you're able to use jQuery, here is a [question with a number of good approaches](http://stackoverflow.com/questions/983031/jquery-how-to-freeze-table-header-and-allow-scrolling-of-the-rest-of-the-rows) to doing this on the client-side. – DOK Apr 01 '12 at 20:18
-
@DOK that link is now dead – Matt Wilko Dec 20 '13 at 12:13
-
@MattWilko Too bad. That SO question had 47 up votes and 19 answers with up to 25 up votes each. It was closed as irrelevant by the authorities. However, people with a lot of points can see deleted stuff, so it's def all still there, just for certain people. Shrug. – DOK Dec 21 '13 at 17:23
2 Answers
2
No "native" ASP.NET control, but you could use Ideasparks CoolGridView. It works fine for me and is free.
- Download from Codeplex.com.
Note that ASP.NET is a serverside technology and what you're asking is clientside functionality.

Tim Schmelter
- 450,073
- 74
- 686
- 939
2
There are some tricks with css that you can do and make the header remain visible, and the data scroll.
So here are some links that do that:
http://datawebcontrols.com/demos/ScrollableDataGridFixedHeader.aspx

Aristos
- 66,005
- 16
- 114
- 150
-
I am trying `.fixedHeaderTable`, but I am new to jQuery. I am confuse where I have to write `$('selector').fixedHeaderTable({ footer: true, cloneHeadToFoot: true, fixedColumn: false });`? please explain? – Amit Apr 01 '12 at 21:27
-
@jams You place it after the table has render inside a script, or when the page load (onload), or when the dom is ready using the jQuery.ready() - view the html source on the example to see where. – Aristos Apr 01 '12 at 21:38