alef replied on Wednesday, November 04, 2009
I was thinking of the following objects
1) CategoryList (NameValueListBase)
2) DisciplineList (NameValueListBase)
3) Contest (EditableRoot) with the following properties
- Id
- Title
- Date
- Categories (which points to ContestCategories)
4) ContestCategories (EditableChildList)
5) ContestCategory (EditableChild)
- CategoryId
- Category
- AvailableDisciplines (which points to AvailableDisciplines)
- SelectedDisciplines (which points to SelectedDisciplines)
6) AvailableDisciplines (EditableChildList)
7) AvailableDiscipline (EditableChild)
- Id
- ContestId
- CategoryId
- DisciplineId
- Discipline
8) SelectedDisciplines (EditableChildList)
9) SelectedDiscipline (EditableChild)
- Id
- ContestId
- CategoryId
- DisciplineId
- Discipline
But with this proposal I've some remarks.
- We only have 4 tables, to represent this in an object model we need 9 classes. (so maybe I'm not looking in the right direction?)
- How can I do the binding with the dual listbox control?
I can bind the left listbox to Contest.Categories[0].AvailableDisciplines and the right listbox to Contest.Categories[0].SelectedDisciplines. But when doing this the problem arises that in the left listbox we have AvailableDiscipline listitems and in the right listbox we have SelectedDiscipline listitems. So now when we are moving items from left to right and the other way around we are mixing two types of objects (AvailableDiscipline,SelectedDiscipline). This will give an error, we can't add an object of type AvailableDiscipline to the collection SelectedDisciplines.
Does somebody has any idea to implement this dual listbox concept?