locked
Many to many relationship, Linq to SQL RRS feed

  • Question

  • User1159660203 posted

    Hi everybody,

    is there a way to show a gridview on the Details.aspx page with all "children" from a many to many relationship?

     In the Northwind example, I would like to show a gridview (or even better, a checkbox list) with all the Territories related to the selected Employee (fetched from the EmployeeTerritories table). The next step would then be editing the relationship (hence the checkbox list). I think that this approach adds much more usability than browsing around links and looking at gridviews that show employees and territories Smile

     I'm using Linq to SQL (not the EF).

     

    Thanks!

    Wednesday, September 24, 2008 12:49 PM

Answers

  • User-330204900 posted

    An easy way to do this with the northwind example is to create a calculated property on the EmployeeTerritory entity that reaches out accross the relationship to the Territory entity for the description. Also I'm in the middle of an article that automatically lists all children tables in side a ajax tabbed control, this will be on my blog somtime tomorrow [:D]

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 3:46 PM
  • User-330204900 posted

    Download and have a look at this project here DD_FT_MtoNcustom.zip 

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 6:31 PM
  • User-330204900 posted

    As Promised here’s the article Dynamic Data Custom Pages with Ajax Control Toolkit Tabs hope it points you in the right direction [:D]

    Hope this helps [:D]<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 25, 2008 8:30 AM

All replies

  • User-330204900 posted

    An easy way to do this with the northwind example is to create a calculated property on the EmployeeTerritory entity that reaches out accross the relationship to the Territory entity for the description. Also I'm in the middle of an article that automatically lists all children tables in side a ajax tabbed control, this will be on my blog somtime tomorrow [:D]

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 3:46 PM
  • User1159660203 posted

    That's great!

     

    Could you please provide an example of this calculated property? 

    Wednesday, September 24, 2008 5:55 PM
  • User-330204900 posted

    Download and have a look at this project here DD_FT_MtoNcustom.zip 

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 24, 2008 6:31 PM
  • User1159660203 posted
    Cool example! Thank you! [Yes]
    Wednesday, September 24, 2008 6:46 PM
  • User-330204900 posted

    As Promised here’s the article Dynamic Data Custom Pages with Ajax Control Toolkit Tabs hope it points you in the right direction [:D]

    Hope this helps [:D]<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 25, 2008 8:30 AM
  • User1159660203 posted

    Thumbs up Steve [cool]! Keep up the good work, your blog is probably the most informative and up to date place for dynamic data.
     

    Thursday, September 25, 2008 5:30 PM