问题
I have a asp .net web application where I use GridView. There is whole lot of data in it, making it to scroll horizontal as well as vertical. Now, I wanted to freeze the first column in it while horizontal scroll is happening. I got some help from the forums online and wrote this particular piece of css style:
td.locked, th.locked
{
position: relative;
top: expression(this.offsetParent.scrollTop);
background-color: White;
}
and in the code behind I have this in my grid's RowDataBound event:
e.Row.Cells[0].CssClass = "locked";
But now, freezing of the columns happens in a and if say I have 15 records and my div shows only 10 records and rest has to go for vertical scroll, but the frozen column's 15 rows are overflowing the grid. Please find the screenshot below:

Please let me know what have I missed out so that I could enable vertical scroll for overflown data.
回答1:
Maybe you can try my solution. It can be fixed header and column in gridview.
GridViewScroll with jQuery

回答2:
have you set height and width for the gridview ? try to set height and width for it and set its wrapper's height and width. hope can help you.
来源:https://stackoverflow.com/questions/14038959/column-freeze-in-gridview