1

I am using ASP.NET Dynamic Data. The page dynamically creates a List, Edit, Details pages to display the records stored in the table in the DB.

I have the Sub Contractors in the table but I want its visibility set to false on screen. I've tried

[HideColumnIn(PageTemplate.List)]
[Display(Name = "SubContractor Id", Order = 70)]
public object SubContractorId { get; set; }

ALSO:

[ReadOnlyColumnIn(PageTemplate.List)]

But no joy. Iv made these changes in the database.cs file. Anyone know how can I make it disappear or remove the hyperlink from it?

EDIT:

[ScaffoldColumn(false)] usually works but because SubContractorId is a FK it seems to not take effect.

Konstantin
  • 796
  • 1
  • 11
  • 32
Mick
  • 183
  • 2
  • 3
  • 12
  • possible duplicate of [Hide a column in ASP.NET Dynamic Data](http://stackoverflow.com/questions/25653/hide-a-column-in-asp-net-dynamic-data) – Chains Mar 25 '13 at 16:55
  • looked at it but because sub contractor is a FK, it doesn't have the effect as it should with [ScaffoldColumn(false)] – Mick Mar 25 '13 at 16:58

1 Answers1

1

Consider the possibility of using Custom pages (List and other) for your Dynamic Data site which allows you hide specific fields.

For more information: How to: Customize the Layout of an Individual Table By Using a Custom Page Template

Konstantin
  • 796
  • 1
  • 11
  • 32