Custom Standalone Table View

Nov 29, 2011 at 1:00 PM

Hi,

I have a domain object (User) that has more than 10 string properties.  As a result it does not render very cleanly as a table with lots of wrapping.  Therefore I have written a custom standalone table view which hides some of the properties that aren't relevant when viewing collections.

This all now looks great. 

BUT

when I view or edit another domain object (Group) which has a collection of Users, the table displayed there is not a standalone table and therefore still renders all of the properties.

How can I ensure reduce the properties shown when viewing ICollection navigation properties as a table in another domain object?

Coordinator
Nov 29, 2011 at 3:53 PM

You can create a custom view for the Group object.  List the properties without the collection(s) (using Html.PropertyListWithout) and then add the collection separately using Html.CollectionTableWith  (or CollectionTableWithout) to specify the columns you want. 

Nov 30, 2011 at 8:35 AM

Hi Richard,

That's exactly what I thought I would need to do.

Cheers

Paul