I have one doubt in Silverlight project that using MVVM architecture..
I have an ObservableCollection, the structure is this..
internal static class EmployeeDataHelper
{
internal static ObservableCollection<Employee> CookEmployeesData()
{
ObservableCollection<Employee> sampleEmployees = new ObservableCollection<Employee>();
sampleEmployees.Add(new Employee("B007", "James Bond", 42, "Secret agent 007"));
sampleEmployees.Add(new Employee("C002", "Charlie Jackson", 22, "Assistant to Bond"));
return sampleEmployees;
}
}
Here <Employee> is a class that contains get and set for the above values.
Now i need to bind the collection like that in combobox..
B007
C002
etc..
like that..
How i can give the design coding for Combobox..
<ComboBox ItemsSource="{Binding Path=Employees,UpdateSourceTrigger=PropertyChanged}"
Grid.Column="2" Height="23" HorizontalAlignment="Left" Margin="112,12,0,0"
Name="comboBox1" VerticalAlignment="Top" Width="120" />
if i give this means i not able to get the exact result.. please help me if u know..
you can do something like this , set
DisplayMemberPath