Click here to Skip to main content
15,885,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is more of a what's the best way question.

I have four combo boxes in an application that are bound to the same lookup table. There are 900 records in the lookup table. Three of the comboboxes are lookups for different fields in my employee table. The last of the four comboboxes is a filter for the employee table. This last combobox can be filtered in a different way from the other three. The list can also be the same as the other three.

What? You may ask. Think of the look up table as a list of stores. So one field is where you buy your clothes, one field is for your shoes and one for your appliances. So the list of stores is always the same but the three data fields can be the same or different.

The application works fine. Currently I have four different classes and four different domain data sources for each of the combo boxes in the application.

I am sure there is a better way than loading the same data four times. Can someone suggest the optimal way to clone or copy the data sources? Do I even need four data sources?

One other important fact. Only one of the three data combo's will always have data. Most of the time the other two could be loaded only if there is data in the field or the dropped event.

Larry Freedman
Posted

If you're using data sources defined in your xaml, perhaps a proper data layer would be cleaner ? You can use the clone method to copy a data source, but if you link four controls to the same datasource, in informs they would synch their selection. Not sure about silverlight, in that regard.
 
Share this answer
 
As of yet I have not been able to find a way to clone the data source in WCF. Maybe there is some way the query could return a list and I could clone the list but that is why I am reaching out for some answers.


Thanks for the response.

Larry
 
Share this answer
 
Comments
Christian Graus 24-May-10 15:23pm    
No problem. You should use the comment link to post non answers, not the answer button, as I did here.
larry118 24-May-10 15:32pm    
I can do that. I was wondering how this worked.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900