Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

frozen page header in asp.net

Does anyone know a way i can place a user control that consists of a nav menu so that it is always present in the web page on top?  My problem is i have datagrids with thousands of rows, and if i put the grid in a label, it destroys my abiliity to maintain the frozen column headers. Thus, I cannot just put the grid within div tags and implement scrolling.  The only thing I can find so far is frames, but frames suck.  Suggestions?

grover
Tuesday, November 02, 2004

adfasdf
asdfsdfasdf

asdfasdfasdfdsaf
Tuesday, November 02, 2004

You say you can't put the datagrid in a div tag. Why? I'm not understanding...

Remove the column headers and place them in a separate area, either statically or dynamically. Then place the datagrid in a span or div tag with the "overflow: auto" style.

You'll need to fix the columns in the data grid to a specific width, and make sure the header columns are the same width as the data grid columns.

Bryan Jonker
Wednesday, November 03, 2004

You'll probably need to use frames. You can use CSS, but for that kind of thing, it's more complex and IE has some bugs with scrollable DIVs (i.e., like not supporting them). :-p

Brad Wilson
Wednesday, November 03, 2004

"IE has some bugs with scrollable DIVs (i.e., like not supporting them)"

WTF, that's not true at all. I use scrollable DIVs in IE all the time and they have worked perfectly for years.

Nemesis [µISV]
Thursday, November 04, 2004

Really? You put a "height" style on a DIV, and every browser scrolls it, except IE. Care to share the secret?

Brad Wilson
Friday, November 05, 2004

(forgot to mention the "overflow: scroll", but I'm assuming you know that)

Brad Wilson
Friday, November 05, 2004

There's no secret Brad, it just works. Always has.

Here you go, try this:

<HTML>
<HEAD>
<TITLE>DIV Test</TITLE>
</HEAD>
<BODY>
<H1>DIV Test</H1>
<DIV style="HEIGHT: 200px; OVERFLOW: scroll; BACKGROUND-COLOR: #F0F0F0;">This is the DIV element<BR><BR>This is the DIV element</DIV>
</BODY>
</HTML>

Works just fine, IE puts the scrollbars on, even though it doesn't need them.

I prefer to use "OVERFLOW: auto;" myself, as then it only puts the scrollbars on if it needs to.

Perhaps I've not quite understood what you meant, but this seems to do what you say IE cannot do.

Nemesis [µISV]
Saturday, November 06, 2004

*  Recent Topics

*  Fog Creek Home