Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a gridview that is over 20 columns.  I am trying to get the header to not scrollable.  Below is my current code.  

<pre lang="vb">
<div id="divElementInfo" runat="server" style="width: 90%;">
            <div runat="server" style="width:900px;height:400px;overflow:auto">
                <asp:GridView ID="gvElementInfo" runat="server">
                    <AlternatingRowStyle BackColor="#CCCCCC" />                            
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="90px" />
                    <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="90px" />
                </asp:GridView>
            </div>
    </div>



What I have tried:

I have tried all of the suggestions, but I haven't found anything for the vertical scroll.
Posted
Updated 20-Nov-19 21:41pm

1 solution

Gridview will be converted in html table at the time of rendering. You can use some css for that. Here are some samples
Position Sticky and Table Headers | CSS-Tricks[^]
https://codepen.io/tjvantoll/pen/JEKIu[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900