Asked by:
Adding multiple grids for viewing related entities of an entity

Question
-
User320031091 posted
I have an entity say Employee which has links to contacts, addresses e.t.c. The default code generated by dynamic data generates a page for an employee which has buttons to show all contacts and a separate button to show all addresses. I'd like to show all the contacts within the other employee details like name , surname rather than having to navigate to a separate page.
How can I best do this?
In relation to this do I simply use the basic generated pages and then modify them, but what if then make changes to the data model, do my original changes get overwritten?
Wednesday, September 17, 2008 4:29 PM
All replies
-
User-330204900 posted
Hi Matt have a look at my series on FieldTemplates here:
- Your First FieldTemplate.
- An Advanced FieldTemplate.
- A Second Advanced FieldTemplate.
- An Advanced FieldTemplate with a GridView.
- An Advanced FieldTemplate with a DetailsView.
- An Advanced FieldTemplate with a GridView/DetailsView Project.
You want to the what I've now called the ChildrenGrid (old name An Advanced FieldTemplate with a GridView) FiledTemplate I think.
hope this helps [:D]
Thursday, September 18, 2008 2:01 AM -
User320031091 posted
Thanks Steve I'll review all of the links in detail shortly.
One thing I'm puzzled on though is from
http://csharpbits.notaclue.net/2008/08/dynamic-data-and-field-templates.html
why would you have to change a page template into a field template, aren't you just embedding a page template in another page template?
Thursday, September 18, 2008 2:20 PM -
User-330204900 posted
No problems it just gives you sort of a mater detail type page real easy, if you add it via UIHint on a Children column then you get the all the child records for that master record
i.e. Northwind Orders->Order_Details
It is usefull, also I added a ForeignKey ParentDetail FT the allows you to look bac from the detail at the MasterParent record.
Hope this helps [:D]
Thursday, September 18, 2008 2:54 PM -
User-330204900 posted
The other way to go is custom pages, try this series on my blog:
-
Custom Pages Part 1 - Standard Custom Page based on an existing PageTemplate and customised in the DynamicData\CustomPages folder.
- Custom Pages Part 2 - A completely Custom Page again in the DynamicData\CustomPages folder.
- Custom Pages Part 3 - Standard ASP.Net Page with Dynamic Data features added to take advantage of the FieldTemplates.
- Custom Pages Part 4 - A DetailsView and a GridView using Validation Groups
Hope this helps [:D]
Friday, September 19, 2008 2:38 AM -