在GridView中冻结列 [英] Column freeze in GridView

查看:231
本文介绍了在GridView中冻结列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net的web应用程序,我使用GridView。其中有大量的数据,使其滚动水平和垂直。现在,我想在水平滚动发生时冻结第一列。我从网上论坛得到了一些帮助,并写下了这段特殊的css风格:

  td.locked,th.locked 
{
position:relative;
top:expression(this.offsetParent.scrollTop);
背景颜色:白色;





在后面的代码中,我在我的网格的RowDataBound事件中有这个: p>

  e.Row.Cells [0] .CssClass =locked; 

但现在,冻结列发生在一个和如果说我有15个记录,我的div显示只有10条记录和休息必须进行垂直滚动,但冻结列的15行正在网格中溢出。请查看下面的截图:



请让我知道我错过了什么,这样我才能为垂直滚动数据溢出。 可能你可以试试我的解决方案它可以在gridview中修正头和列。



GridViewScroll with jQuery




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.

解决方案

Maybe you can try my solution. It can be fixed header and column in gridview.

GridViewScroll with jQuery

这篇关于在GridView中冻结列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆