I would like an array of 10 combo boxes on a wpf form.
The ItemsSource of the combo boxes are identical – an ObservableCollection of selectable Items.
Each Selected Item will bound to an item in a different ObservableCollection, imaginatively called ‘SelectedItems’..
What is the best way to do the array? I could of course have 10 separate combo boxes but this would be not very elegant..
I don’t think an ItemsControl template is what I’m after as the number of combo boxes is static.
Thanks
Joe
If I understand you right, you have 10 ComboBoxes with the same item list, but different data sources
In that case, I could create a common style for the ComboBox which sets the common properties such as
ItemsSource(andSelectedItemif the binding is the same for all items), and then actually create the individual ComboBoxes on the form as needed.Of course, if the DataSource for your ComboBoxes CAN be put in a collection, it is preferred that they are and that you use an
ItemsControlto display the ComboBoxes