将visible = false设置为asp:BoundField

发布于 2024-08-13 09:21:12 字数 201 浏览 4 评论 0原文

我有一个 gridview 宽度绑定字段:

<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome"  />

我想通过 page_load 方法中的条件设置它的可见参数。

有可能吗?

谢谢

i have a gridview width a boundfield:

<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome"  />

i want set the visible parameter of this by a condition in page_load method.

is possible?

thanks

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

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

发布评论

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

评论(1

月牙弯弯 2024-08-20 09:21:12

调用 EnsureChildControls() 后,您将能够迭代 GridViewRows 并使用 FindControl 选取此字段(假设您设置了 ID 并 runat="server")。

After calling EnsureChildControls(), you will be able to iterate over the GridViewRows and use FindControl to pick out this field (assuming you set an ID and runat="server").

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文