GridView 上的滚动条

发布于 2024-08-16 04:47:08 字数 129 浏览 5 评论 0原文

我想在 ASP.NET 中的 GridView 上放置一个滚动条。我创建了一个母版页。在此页面中,我想要一个具有静态高度和宽度的窗口,并在该窗口内放置一个 GridView。

可以在 Visual Studio 中执行此操作吗?

I want to put a scrollbar on a GridView in ASP.NET. I have created a master page. In this page I want a window with static height and width and inside this window put a GridView.

Is it possible to do this in Visual Studio?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦在深巷 2024-08-23 04:47:08

为什么不将该网格放入 div 中并为其添加溢出。因此,一旦网格被渲染,它将被包含在带有滚动条的 div 中。

<div style="overflow: auto; width: 200px; height: 200px">
     <asp:GridView ID="GridView1".....
</div>

Why not put that grid in a div and add an overflow to it. So, once the grid is rendered, it will be enclosed in that div with scrollbars.

<div style="overflow: auto; width: 200px; height: 200px">
     <asp:GridView ID="GridView1".....
</div>
勿挽旧人 2024-08-23 04:47:08

您可以尝试将 gridview 放在 div 中,然后设置高度并添加 CSS overflow< /a> 风格。

例如。

<div style="height:400px; overflow:scroll">
   <asp:Gridview ID="Gv1" runat="server" />
</div>

You could try putting the gridview within a div and then setting a height and adding CSS overflowstyle to it.

eg.

<div style="height:400px; overflow:scroll">
   <asp:Gridview ID="Gv1" runat="server" />
</div>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文