ASP .NET网格控件 [英] Asp .net Grid control

查看:85
本文介绍了ASP .NET网格控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
有人可以指导我如何将网格放在滚动条中,以便网格行不会出现在页面布局之外吗?

OP的答案移至此处:
我的网格有将近15列,我正在使用div,但是网格不在div上.我将宽度设置为400px,但再次无法正常工作.我需要水平滚动条并且分页已经是uesd

HI to everyone
can anybody guide me that how i can put my grid in scroll bar so that my grid row didnt comes out of page layout thanks in advance

OP''s answer moved to here:
my grid has almost 15 coloumn and i am using div but grid is going outside the div.i has set width to 400px but again its not working.i need horizontal scroll bar and paging is already uesd

推荐答案

将Grid控件置于Panel控件中,并将Panel scrollbars属性设置为水平.
Put your Grid control in Panel control and set the Panel scrollbars property to horizontal.
<asp:Panel ID="Panel1" runat="server" ScrollBars="Horizontal">
    </asp:Panel>



我希望这对您有帮助.



I hope this will help you well.


尽管该教程位于VB.NET中,但可以用作解决方案的html部分应该至少为您提供一个有关如何做的想法.这个.

教程...


根据问题的增强,您只需要使用"overflow:auto;"即可.网格周围的div中的属性.这将自动创建水平和垂直滚动条.
[/Edit]
Although the tutorial is in VB.NET, the html portion that you could potentially use as a solution should give you at least one idea on how to do this.

Tutorial...


Based on the enhancement to your question, you just need to use the "overflow: auto;" attribute in the div surrounding your grid. This will automatically create horizontal and vertical scrollbars.
[/Edit]


您可以尝试几种方法.

1)使用paging而不是滚动. Gridview具有简单的分页支持.

2)让容器具有滚动,而不是使gridview滚动.将gridview包裹在DIV部分中.设置DIV的宽度和高度.使用CSS属性overflow进行滚动.

祝你好运
There are few ways you can try.

1) Use paging instead of scrolling. Gridview has a easy paging support.

2) Instead of make the gridview scroll, let the container has the scroll. Wrap the gridview in a DIV section. Set the width and height of the DIV. Use the CSS property overflow to scroll.

Good luck


这篇关于ASP .NET网格控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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