views:

41

answers:

1

I want user to be able to scroll in a div to see all the rows. But setting div's overflow property to true. When I starts scrolling header goes away. Is it possible to make header static. So that I can sort or do any kind of other operations.

Currently I tried to take fixed table above grid and hiding grids header. But on editing it is not expanding as the grid is expanding.

+1  A: 

Article : Grid View with fixed header

For the gridview to freez the header

div#gridPanel 
{
   width:900px;
   overflow:scroll;
   position:relative;
}


div#gridPanel th
{  
   top: expression(document.getElementById("gridPanel").scrollTop-2);
left:expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
   position: relative;
   z-index: 20;
}


<asp:Panel ID="gridPanel" runat="server" Height="200px" Width="100px" ScrollBars="Auto">
   asp.net grid view
Pranay Rana
@Pranay: This works in IE 7 but not in IE 8 as Expression has been depreciated in IE8. Any other solution will be appreciable.
Shantanu Gupta