Freeze the DataGrid Headers

B

Ben

Is there any way to freeze the DataGrid headers so that
the headers are always viewable while srolling down?

Thanks in advance,
Ben!
 
T

Teemu Keiski

Hi,

you need to output the datagrid content into scrollable DIV element and
again headers are then "out" of this DIV so that content scrolls but headers
stay fixed. You can do it manually grid by grid (grid without headers into
DIV and headers done manually into separate table) or develop a custom
DataGrid control (with customized rendering) to do the task. Interscape USA
(www.interscapeusa.com) has such control for sale and with very low price.
 
A

Alvin Bruney

look up this topic on aspnetpro website. dino esposito has written two
articles, one in october, and one in december explaining how to do this.
 
S

Steve C. Orr [MVP, MCSD]

You must make the header a separate grid.
This is a limitation of HTML.
 
T

Teemu Keiski

Hi,

sorry for delay. interscapeusa.com was down for some time (Interscape is a
company owned by Robert McLaws, one of my fellow MVPs)

Scrollable DIV is a DIV with overflow, overflow-x or overflow-y style
attributes, for example

<DIV style="overflow-y:auto;height:180px">
....content goes here
</DIV>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top