Click here to Skip to main content
15,895,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do you set the headers within the style properties such that the gridview headers are 'fiexd'.

and not scroll along.


XML
<td class="style32" colspan="8">
               <div style="height: 83px; overflow: auto; empty-cells: show;">
                   <asp:GridView ID="GridView1" runat="server" Font-Size="X-Small" PageSize="5"
                       BackColor="White" onselectedindexchanged="GridView1_SelectedIndexChanged" >
                       <Columns>
                           <asp:CommandField ShowSelectButton="True" />
                       </Columns>
                   </asp:GridView>
               </div>
           </td>
Posted

Don't you have access to Google? See this : gridview with fixed header in asp.net[^]. Such questions can easily be solved using your favorite search engine.

Regards..
 
Share this answer
 
Comments
Member 10744248 26-Jun-14 7:11am    
I have done that but it didn't work please.

Don't underrate some questions. It looks so simple if you already know it.
use repeater for that.

put header in a table, tr and in below table put repeater with enclosed div and above defined property.

Using this, repeater data will be scroll and your header will be freeze.

or in grid, you can set showheader property also set to false and put header in different table.
 
Share this answer
 
v2

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