In my current consulting project, I needed to create a control that would allow me to scroll the rows but keep the top row frozen. Admittedly, this created quite a challenge.
I finally found an article that lead me in the right direction
http://web.tampabay.rr.com/bmerkey/examples/locked-column-csv.html
In order to lock the header of a table server control. Create a style sheet with the following style for your td tag:
td.locked
, th.locked{border-right: 1px solid silver;
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft); /* IE5+ only */
position
: relative;z-index: 10;
background-color:#ACCBE0;
border-color:#D3E0EA;
}
Reference your style sheet in your page's header:
<
head runat="server"><link rel="stylesheet" href="../App_Themes/LockingHeaderRow.css" type="text/css" title="" />
<title>Master Page</title>
</head>
The table must be initially inside a div tag to scroll:
<
div id="persistMe" runat="server" style="width:1000px; height:300px; overflow:auto; z-index:55" > <asp:Table ID="Table1" runat="server" GridLines="Both" EnableViewState="false" BorderStyle="Solid" BorderWidth="1" Width="1000px" >
Rob UnverzagtPosted Jul 19, 2008, 6:42 PM
I am trying to do essentially this same thing. I am using an sQuery statement to return files and I ave my HTML set to receive the files but how would I do what you are suggesting? I am not very good at it, so I will have many questions.