I've got a WPF window bound to a parent table. The parent table has a primary key comprised of ClientNumber and CaseNumber. Associated with the parent table is another table, called Problems. It has a primary key comprised of ClientNumber, CaseNumber and ProblemID. So, there's a one-to-many relationship between the parent table and child table. Then there's a third table, let's call it ProblemsLookup, which has as it's primary key ProblemID, and then it has a string field for a description. In that description field are things like, "Money issues", "Work problems", "Family problems", etc.
On the window I want to have 2 listboxes, one that initially will have all of the items listed in the ProblemsLookup table, and I'll put that on the right side. The second listbox I want to have all of the problems the person has, drawn from the first listbox. So, the first problem I want to solve is, how to I drag-and-drop from the left listbox to the right listbox?
Second problem, when the user does a search and finds someone in the database who already has some problems associated with them, I don't want those problems to appear in the left listbox. Thus suppose the user searches for someone who has stated they have work problems. So when this window comes up I want it to show just "Money issues" and "Family problems" in the left listbox, and in the right listbox it will show "Work problems". If the user drags "Work problems" from the right listbox, I want it to remove it from the child table. If they drag anything from the left listbox to the right listbox, I want it to add that to the child table. As you can see, both tables have different schemas. So I'm not sure how to make this work. I could really use some direction/guidance as to how to proceed with implementing something like this.
Rod