Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ComboBox ItemsSource data dilemma?
Message
De
13/07/2008 23:33:22
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
ComboBox ItemsSource data dilemma?
Divers
Thread ID:
01331016
Message ID:
01331016
Vues:
61
I'm going to use a particular ComboBox very often in my app... A lookup ComboBox control that that has ItemsSource set to a colection of objects that are EmployeeID's and EmployeeNames, with SelectedValuePath and DisplayValueMember set to the obvious setting just mentioned fields, and then I will have it using the SelectedValue property to get/set the actual field value in the Linq-to-Sql model.

Obviously, the point of this is the very common practice of storing the EmployeeID as a foreign key in a record, using the ComboBox to limit the user to only valid choices.

However, how do you deal with the fact that when an employee is terminated, they are not a valid choice any longer to choose for a new record, but you must still display there name for records that were made when they were an active employee?

On the one hand, my ItemsSource collection must be complete with ALL employees in order for the UI to display the employee name for older records, but then other hand it only needs to have a list of ACTIVE employees when the UI is in "add mode" or maybe even "edit mode".
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform