Karadous
Karadous

Reputation: 1635

How to remove related tables from list.aspx in dynamic data

I'm using ASP.NET Dynamic Data.

  1. When table rows are listed in List.aspx there are columns that show the name of tables that have foreign key to this table. These columns are not a field in table and Dynamic Data generates them automatically. How can I remove them?
  2. How can I remove filters that are shown for each table?

Upvotes: 0

Views: 382

Answers (2)

Ash Machine
Ash Machine

Reputation: 9911

Use Metadata tag DisplayAttribute in System.ComponentModel.DataAnnotations. Here is an example to hide the Category column in a table and do not create a filter:

[Display(Name="Categories", AutoGenerateField=false, AutoGenerateFilter=false)]        
public object Cats { get; set; }

Upvotes: 1

Jeremy
Jeremy

Reputation: 9030

It's just a google away. Also, stack is your friend. Here's a video tutorial that may help you: How to Remove Columns From Your DynamicData Data Grids. Here's a stack post that may also help you: How to hide filtered column with dynamic data site?

Upvotes: 0

Related Questions