C# ItemsSource for ComboBox with inheritance

184 Views Asked by At

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?

1

There are 1 best solutions below

0
On

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