Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Freeze Header Row

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ben - 25 Oct 2007 18:37 GMT
I have some code I use in ASP to freeze a tables header row.  Works
good in ASP.  But if I do the same in a .NET 2.0 page, the result is
different -- the header column is show in its entirety instead of
being cut-off by the width of the DIV it's in.  You can see my sample
code below... any idea why it's behaving differently ?

<div style="background-color:offwhite;overflow:auto; width: 100%;
height: 400px;border-left: 1px gray solid; border-top: 1px lightgrey
solid; padding:0px; margin: 0px">
   <center style="font-size: 10px; font-family: Arial">

       <table id="tblClients" border="0">
    <tr
style="position:relative;top:expression(this.offsetParent.scrollTop);">
        <th>ComputerName</th><th>SIMSVersion</th><th>OSUpTimeInHours</
th><th>ClientUpTimeInHours</th><th>ClientStartTime</th><th>LastUpdate</
th><th>LastMemUsage</th><th>ClientHealth</th><th>ClientHealthDetail</
th><th>LastFullScanRequestDate</th><th>LastFullScanSent</
th><th>LastFullScanLoad</th><th>FileCount</th><th>IsLoadInProcess</
th><th>ClientGUID</th>
    </tr>
</table></center>
   </div>
Ben - 25 Oct 2007 20:29 GMT
> I have some code I use in ASP to freeze a tables header row.  Works
> good in ASP.  But if I do the same in a .NET 2.0 page, the result is
[quoted text clipped - 19 lines]
> </table></center>
>     </div>

i don't know if i explained myself right... in more simple terms, if I
have a table in a DIV, and I make a row have a position=relative, that
row does not appear to be contained inside the DIV anymore... if you
scroll the DIV horizontally the row with 'relative' position does not
move.

this only happens to me on an aspx page... on asp it works ok.

can anyone offer tips ?  I'm sure .NET has some ability to show a
frozen header row (while maintaining horizontal scrolling ability).
Ben - 25 Oct 2007 20:46 GMT
> > I have some code I use in ASP to freeze a tables header row.  Works
> > good in ASP.  But if I do the same in a .NET 2.0 page, the result is
[quoted text clipped - 32 lines]
>
> - Show quoted text -

Cool, i found the solution...  if you make the DIV have
position=relative as well, it works as it did in ASP.... sweet !

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.