-3

I've got a List<T> like:

List<Person> personList;

In this list are objects that inherit from Person: Staff and Manager.

I have a ComboBox cmbList.

Now I would like to set the source of this ComboBox to the Staff objects from the personList.

How can I create a view, so that it looks like two Lists?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
  • 1
    It's a bit unclear what you're asking. Do you want two comboboxes? Do you want some code that will get just the `Staff` objects from the `personList`? – Heretic Monkey Nov 15 '14 at 00:16
  • I want one combobox. I want to use itemsSource, but only for one kind of objects (Staff). I know a method, but then I need to set the items every time new... I now seperated the List in two Lists and just used itemsSource – Benjamin Nopper Nov 18 '14 at 23:10

1 Answers1

0

you can use a ICollectionView to filter your PersonList for Staff Objects and bind this view to your Combobox

blindmeis
  • 22,175
  • 7
  • 55
  • 74