How can I handle many to many relationships where the join table contains extra fields? For example, I have three tables: students, courses, and studentcourses. The studentcourses table (join table) contains the StudentID, CourseID, and Date Registered.
I would like to display a checkbox for each course available to the student and a text box where the DateRegistered can be entered.
As far as I know out of the box DD gives you the checkbox selection when you have a join table which has a PK of the studentID and the courseID, but no extra fields are welcome.
if the table has extra fields Entity Framework will not treak the table as a M:M so you will have to code you own custom field template to do what you want.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
ijgarcia
Member
4 Points
4 Posts
Dynamic Data Many to Many Relations (Join Tables with Payload)
Nov 15, 2011 03:42 PM|LINK
How can I handle many to many relationships where the join table contains extra fields? For example, I have three tables: students, courses, and studentcourses. The studentcourses table (join table) contains the StudentID, CourseID, and Date Registered. I would like to display a checkbox for each course available to the student and a text box where the DateRegistered can be entered.
Yannick86
Member
565 Points
366 Posts
Re: Dynamic Data Many to Many Relations (Join Tables with Payload)
Nov 16, 2011 07:03 AM|LINK
As far as I know out of the box DD gives you the checkbox selection when you have a join table which has a PK of the studentID and the courseID, but no extra fields are welcome.
sjnaughton
All-Star
27330 Points
5459 Posts
MVP
Re: Dynamic Data Many to Many Relations (Join Tables with Payload)
Nov 17, 2011 12:31 PM|LINK
if the table has extra fields Entity Framework will not treak the table as a M:M so you will have to code you own custom field template to do what you want.
Always seeking an elegant solution.