将滚动条添加到GridView [英] Adding scrollbar to GridView

查看:72
本文介绍了将滚动条添加到GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.Net中找到了gridview的分页,但是我需要在gridview中添加有效的滚动。我使用了溢出方法,但是使用了该列标题也滚动了。

I have find paging of the gridview in ASP.Net ,But I need adding virtical scroll to gridview.I have used overflow methos but using that Column header also scrolled.

推荐答案

如果只需要垂直滚动条,可以使用潜水或面板如下所示

you can use dive or panel as below if you need only vertical scroll bar
<div style="width: 100%; height: 400px; overflow: scroll">your GridView</div>



但是如果你想要有垂直滚动的固定标题,请阅读以下链接

http://stackoverflow.com/questions/7625706/fixed-gridview-header-with-horizo​​ntal-and-vertical-scrolling-in-asp-net [< a href =http://stackoverflow.com/questions/7625706/fixed-gridview-head er-with-horizo​​ntal-and-vertical-scrolling-in-asp-nettarget =_ blanktitle =New Window> ^ ]


这些链接可能帮助您

http:// stackoverflow。 com / questions / 9247818 / gridview-with -zedzed-header-and-first-four-columns [ ^ ]

http://www.bluelemoncode.com/post/2011/12/30 /Freezing-gridview-header-and-columns-while-scrolling-rest-of-the-content.aspx [ ^ ]

http://forums.asp.net/t/1446097.aspx/1 [ ^ ]
These links may help you
http://stackoverflow.com/questions/9247818/gridview-with-freezed-header-and-first-four-columns[^]
http://www.bluelemoncode.com/post/2011/12/30/Freezing-gridview-header-and-columns-while-scrolling-rest-of-the-content.aspx[^]
http://forums.asp.net/t/1446097.aspx/1[^]


使用 div 指定div的宽度和高度你想要你的网格。

将你的网格保留在这个div中。

现在在你的样式标签中添加溢出:滚动它会放一个滚动给你。



希望这有帮助!!!
use a div specify your width and height of div as you want for your grid.
keep your grid inside this div.
now add overflow:scroll in your style tag it will put a scroll for you.

hope this helps!!!


这篇关于将滚动条添加到GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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