Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to set a scroll for gridview with header & footer fixed?
Posted

Hi Munirajan,

1.There is a property called useaccessible header in gridview, set this true but it works only in IE.

2.Disable header and footer of gridview and add an html table of same width above and below the grid. In header table place your grid headings and in footer table place your footer things.

Hope this helps
 
Share this answer
 
 
Share this answer
 
v2
Comments
thatraja 8-Nov-11 9:18am    
5!
P.Salini 8-Nov-11 23:06pm    
Thank you Raja
 
Share this answer
 
Comments
thatraja 8-Nov-11 9:18am    
5!
 
Share this answer
 
Comments
thatraja 8-Nov-11 9:14am    
5!
sravani.v 9-Nov-11 0:53am    
Thank you thatraja
I found this article Grid View with Fixed Header[^]. This solution is tested well with Internet Explorer, Mozilla Firefox, and Google Chrome.
 
Share this answer
 
Comments
koolprasad2003 8-Nov-11 6:01am    
nice link, Raja. 5!
Hi,

following css also fixes gridview header

C#
.grid-header
{
font-weight: bold;
font-family: Verdana;
font-size: 11px;
background-color: #7A9FCB;
text-decoration: underline;
color: #ffffff;
text-align: left;
position: relative;
top:expression(this.parentNode.parentNode.parentNode.scrollTop-2);
left:expression(this.parentNode.parentNode.parentNode.scrollLeft-1);
right:1px;
}



and place the following tag in your page head section
<meta http-equiv="X-UA-Compatible" content="IE=7" />
 
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