如何隐藏仅在ASP.NET动态数据的列表页面上的列? [英] How do I hide a column only on the list page in ASP.NET Dynamic Data?
问题描述
这有点类似于这个问题。
不过,而不是想隐藏的列都在一起,我只是希望隐藏List.aspx页面上的栏位。
However, rather than wanting to hide a column all together, I am just looking to hide the column on the List.aspx page.
我的具体的例子是,那些长期(或至少为nvarchar(MAX))从List.aspx页面自动隐藏原样,但仍然是Edit.aspx页面上可见。
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.
这可能吗?
推荐答案
您可以为您要更改的特定表创建一个自定义的页面。这里有一个例子<一个href=\"http://davidhayden.com/blog/dave/archive/2007/12/30/ASPNETDynamicDataWebsitesCustomizingPagesValidation.aspx\"相对=nofollow>这里。
You can create a custom page for the particular table you want to change. There's an example here.
在自定义页面,则可以设置的AutoGenerateColumns =false的
的 ASP中:GridView的
控制,然后定义正是你想要的列,就像这样:
Within your custom page, you can then set AutoGenerateColumns="false"
within the asp:GridView
control, and then define exactly the columns you want, like this:
<Columns>
...
<asp:DynamicField DataField="Product" HeaderText="Product" />
<asp:DynamicField DataField="Colour" HeaderText="Colour" />
</Columns>
这篇关于如何隐藏仅在ASP.NET动态数据的列表页面上的列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!