如何在 ASP.NET 动态数据中仅隐藏列表页面上的列?
这有点类似于这个问题。
但是,我不想隐藏所有列,而只是想隐藏 List.aspx 页面上的列。
我的具体示例是,长字段(或至少是 nvarchar(MAX))会自动从 List.aspx 页面中隐藏,但在 Edit.aspx 页面上仍然可见。
我想为其他(较短的)列复制此行为。
这可能吗?
This is somewhat similar to this question.
However, rather than wanting to hide a column all together, I am just looking to hide the column on the List.aspx page.
My specific example is that fields that are long (or at least nvarchar(MAX)) automatically hide from the List.aspx page as is but are still visible on the Edit.aspx page.
I would like to replicate this behaviour for other (shorter) columns.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果你使用 bootstrap 你可以这样设置
if u r using bootstrap u can set like this
您可以为要更改的特定表创建自定义页面。 此处有一个示例。
在自定义页面中,您可以在
asp:GridView
控件中设置AutoGenerateColumns="false"
,然后准确定义所需的列,如下所示:You can create a custom page for the particular table you want to change. There's an example here.
Within your custom page, you can then set
AutoGenerateColumns="false"
within theasp:GridView
control, and then define exactly the columns you want, like this:我认为这个解决方案非常有用,因为它允许您使用属性模型来指定哪些列位于何处:
http://csharpbits.notaclue.net/ 2008/10/dynamic-data-hiding-columns-in-selected.html
I think this solution is a really useful one, because it allow you to use the attribute model to specify which columns go where:
http://csharpbits.notaclue.net/2008/10/dynamic-data-hiding-columns-in-selected.html