How do I hide a column only on the list page in ASP.NET Dynamic Data?

℡╲_俬逩灬. 提交于 2019-12-04 16:10:01

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 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>

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

if u r using bootstrap u can set like this

<asp:DynamicField DataField="Id" ItemStyle-CssClass="hidden" HeaderStyle-CssClass="hidden" FooterStyle-CssClass="hidden"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!