简体   繁体   English

如何在gridview中的asp.net C#中垂直实现分页

[英]how to achieve paging vertically in asp.net C# in gridview

I want to have paging in my asp.net gridview but here is the twist, I want the paging vertically. 我希望在我的asp.net gridview中进行分页,但这里是扭曲,我想垂直分页。 ie when I hit page up and page down paging should occur vertically. 即当我点击页面并向下翻页时,页面应垂直发生。 Like when I do normal paging 1,2,3,4..... pages occur but I want no 1,2,3,4..pages, I want it to be done vertically when I hit page up and page down considering 10 records per page 就像我正常分页1,2,3,4 ......页面出现但我不想1,2,3,4 ......页面时,我希望它在页面向上和向下翻页时垂直完成考虑每页10条记录

Wrap your gridview around a div and add width height and overflow:scroll to the div's style attribute. 将您的gridview包裹在div周围并添加width heightoverflow:scroll到div的样式属性。

<div style="width: 100%; height: 400px; overflow: scroll">
<ASP:GridView></ASP:GridView>
</div>

Also remove the AllowPaging attribute from the GridView. 还要从GridView中删除AllowPaging属性。 Adjust the width and the height of the div according to your needs. 根据需要调整div的宽度和高度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM