Work on the website is going well and I am adding the more fancy features. I noticed their gridviews were incredibly long vertically so I started adding a scrollbar to sort it out. Problem is that the header disappears. There are a few solutions online but all of the ones I have found either do not solve the problem or use JavaScript.
I am willing to use JavaScript if it comes to it, but ideally would only like to use ASP, C# and CSS (I am trying to keep the code as close to their original layout and code design as possible). Is this possible or is JavaScript the only way to go? I have provided the tags for ASP below
<div style="width: 100%; height: 800px; overflow: scroll">
<asp:GridView ID="grdInventory" runat="server" HeaderStyle-CssClass="FixedHeader" AutoGenerateColumns="False" Width="100%" onrowcommand="grdInventory_RowCommand" >
<RowStyle CssClass="normrow" />
<AlternatingRowStyle CssClass="oddrow" />
<Columns>
...Data...etc...
</Columns>
</asp:GridView></div>
And the CSS current for the FixedHeader style
.FixedHeader
{
position: absolute;
}
Any help would be widely appreciated!