Hide a column in ASP.NET Dynamic Data

北战南征 提交于 2019-11-29 06:01:19

Had no idea what ASP.NET Dynamic Data was so you promted me to so some research :)

Looks like the property you are looking for is

[ScaffoldColumn(false)]

There is also a similar property for tables

[ScaffoldTable(false)]

source

sorgfelt

A much, much easier method: If you want to only show certain columns in the List page, but all or others in the Details, etc. pages, see How do I hide a column only on the list page in ASP.NET Dynamic Data?

Simply set AutoGenerateColumns="false" in the GridView control, then define exactly the columns you want:

<Columns>
...
<asp:DynamicField DataField="FirstName" HeaderText="First Name" />
<asp:DynamicField DataField="LastName" HeaderText="Last Name" />
</Columns>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!