I have a method which returns a generic list (from the db it returns a set of data to a list). I want to bind one property of that list to a combo box using ComboBox's ItemsSource="{Binding Path=ListFirstName}" property. How can i achive this? The code i tried
XAML code:
<ComboBox Name="cmbName"
ItemsSource="{Binding Path=ExamineeList}"
DisplayMemberPath="FirstName" />
XAML.cs code:
Examinee oExaminee = new Examinee();
List<Examinee> ExamineeList;
ExamineeList = oExaminee.ListAll(); //ListAll method returns a generic list
cmbName.DataContext = ExamineeList;