I have three tables. Employee, ClientEmp and Client.
ClientEmp has the ForeignKey
of both Employee (EmployeeID) and Client(ClientID).
So far, I am able to save changes to ClientEmp in my database (using EF
) based on the selected
Client. But I have to type in the EmployeeID ForeignKey
manually in a textbox
to be able to match the data for it to save.
Obviously, this isn't very user friendly if a user has no idea what the EmployeeID FK is enter into the textbox
either.
Therefore, is there a way to show a list
of Employee Firstname's using a combo box
from the Employee table and then save it to the database?
I have tried this, but it doesn't seem to work.
<ComboBox Grid.Column="1" Grid.Row="1" Name="cbEmployeeName"
ItemsSource="{Binding Source={StaticResource Employee}}"
DisplayMemberPath="FirstName"
SelectedValuePath="EmployeeID">
</ComboBox>
I have also tried to use This link and This link here to help but with no avail. What am I doing wrong?
Any help would be much appreciated :).