Tuesday, November 27, 2007

Fixed header solution

 
 
 
**********************************************************************************************************************************************
 
Append this header style to whichever column needs to be frozen
===============================================================
 
<HeaderStyle BorderColor="Black" CssClass="frozenTop" />
 

The division "<div>" which contains the grid needs to be given the below CSS class
==================================================================================
 
<div id="divRSM" runat="server" class="tableContainer">
 
 
 
In the CSS file add this code (This can be modified accrdng to the project standards)
===========================================================================
 
/* Fixed Header Table Styles */
/* define height and width of scrollable area. Add 16px to width for scrollbar */
div.tableContainer
{
 clear: both;
 border: 1px solid #666666;
 margin:0px;
 padding:0px;
 width:100%;
 height:200px;
 position:relative;
}
 
 
 
Add the below style to the master page
======================================
 
<style type="text/css">
.frozenTop {
top:expression(this.offsetParent.scrollTop); position:relative;
z-index:2;
color:#000000;
font-weight: bold;
background-color:#4AC6E0;
height:25px;
padding-left:5px;
padding-right:5px;text-align:center;
border-left-width:1px;
border-right-width:0px;
border-bottom-width:0px;border-top-width:0px;
}
</style>
 

0 comments: