How can I benefit from a listbox in a detailsview with a many-to-many relationship

king_jeremy

Member
Joined
Oct 20, 2009
Messages
13
Programming Experience
Beginner
Hi,
I'm trying to design a detailsView form which contains [classes] --< [studentClasses] >-- [students] tables. There is a many to many relationship between [classes] and [students] through the third table [studentClasses]. I want to design the detailsView of [classes] such as that all [students] will be listed in a listbox but related students that take the class will be highlighted. And when I select/deselect students from the listbox and save I want the changes to be saved to respective tables. So far I couldn't manage to accomplish this. I added a screen capture for the detailsView.
I put a sample project here (www.maestrowebserver.com/sampleProject.zip)
Any suggestions would be really helpfull, thanks.
cap_01.png
 
This is the help page that displays when you press F1 in Data Sources window: Data Sources Window It shows how you can select ListBox and other types of controls for the source fields.
 
This is the help page that displays when you press F1 in Data Sources window: Data Sources Window It shows how you can select ListBox and other types of controls for the source fields.
The example in the help page is for relationships like one-to-many, in my case the scenario is a many-to-many relationship. There are also examples to bind many-to-many but those end up displaying only the students that take the class in the listbox which is not very usefull except for information purposes. In my case I want the listbox to display all the students in students table but highlight those who take the class + when I make any changes in selecting/deselecting any student and hit save it should save the changes. This way it would be a very convenient method to edit such an example in just one detailsView page otherwise either I have to open an extra dialog to add or delete a student or display the students in an other datagridview control which is less userfriendly (see the image below). I hope I could make myself clear.
cap_02.png
 

Latest posts

Back
Top