0

I have grid view which I want to scroll without scrolling header and top border. I have following css solution to scroll gridview without scrolling header row but I am not able to avoid the scrolling of top grid view border.

.HeaderFreez
{
position: relative;
top: expression(this.offsetParent.scrollTop);
z-index: 10;
}

.....
.....

<HeaderStyle CssClass="HeaderFreez" BackColor="Silver" ForeColor="Black" Font-Size="8pt"          BorderStyle="Solid" Wrap="False" />

Is there any solution to avoid the scrolling of top border of grid view in aspx ??

3 Answers3

1

You can look in to the following questions

fixing gridview header while scrolling

Grid view fixed header

similar to what you have asked for.

Community
  • 1
  • 1
Rao
  • 150
  • 4
  • 11
0

You will have to create a header manually and then put it above the grid. This is the only solution.

Here are some good examples

  1. http://csharpdotnetfreak.blogspot.com/2009/07/scrollable-gridview-fixed-headers-asp.html
  2. http://aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-in-ASP.Net.aspx

Similar question on SO

  1. Freeze the Header, Scroll the GridView
  2. Fixed GridView Header with horizontal and vertical scrolling in asp.net
Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117
  • with this solution there is a problem when you have both vertical and horizontal scroll and there is some control like drop down list in left of grid view. the header row will overlap dropdown list present in left of gridview during horizontal scroll – Manak Ram Seervi Jan 31 '14 at 04:54
0

I tried many CSS+Javascript solutions from Git/Google/Web, etc... to use with an ASP.NET Gridview to get fixed THEAD with scrollable TBODY, but the only one that works well is Bootstrap Table. You have to include Bootstrap.

Matt Roy
  • 1,455
  • 1
  • 17
  • 27