Click here to Skip to main content
15,608,404 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I can bind a DataGridComboBox using the SelectedValueBinding and it works ok. My XAML coded properties for DataGridComboBoxColumn

HTML
Header="Empl ID"
ItemsSource="{Binding Source={StaticResource csv}}"
DisplayMemberPath="EmployeeID"
SelectedValuePath="EmployeeID"
SelectedValueBinding="{Binding EmployeeID, UpdateSourceTrigger=PropertyChanged}">



But when I try to bind the Combobox within a DataGridTemplateColumn, the "SelectedValueBinding" is not available. Following is my last updated code. When the window is opened the combobox opens to the first record, but should be the record corresponding to the row in the grid.

HTML
DataGridTemplateColumn Header="Empl ID">
    DataGridTemplateColumn.CellTemplate>
          DataTemplate>
              ComboBox ItemsSource="{Binding Source={StaticResource csv}}" 
                         DisplayMemberPath="EmployeeID"
                         SelectedValuePath="EmployeeID"
                         SelectedValue="{Binding Path=EmployeeID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         TextSearch.TextPath="EmployeeID">



Any Suggestions?

Thanks

What I have tried:

I've tried numerous things, with the last being adding the TextSearch property.
Posted
Updated 19-Sep-16 23:21pm
v2
Comments
Richard MacCutchan 7-Sep-16 11:32am    
Please format code blocks (as I have just done for you), so we can see all the code you have posted.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900