When I click on a cell in my DataGridComboBoxColumn, the ComboBox becomes visible and I can select the elements. When I selected the item visible from above, thatโs fine. But when the aka ComboBox cell loses focus, because I click something else in the DataGrid, then in the cell I previously selected there is no more element / text.
How to save this selected / selected text?
thats my code:
<DataGridComboBoxColumn Width="*" Header="Monday" DisplayMemberPath="SchoolclassName" SelectedValueBinding="{Binding SchoolclassCodeMonday}" ItemsSource="{Binding Source={StaticResource ClassCodes}}"> <DataGridComboBoxColumn.ElementStyle> <Style TargetType="ComboBox"> <Setter Property="IsSynchronizedWithCurrentItem" Value="False" /> <Setter Property="ItemsSource" Value="{Binding Source={StaticResource ClassCodes}}" /> </Style> </DataGridComboBoxColumn.ElementStyle> <DataGridComboBoxColumn.EditingElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding Source={StaticResource ClassCodes}}" /> <Setter Property="IsDropDownOpen" Value="True" /> </Style> </DataGridComboBoxColumn.EditingElementStyle> </DataGridComboBoxColumn>
seems to be the solution to my problem: http://wpf.codeplex.com/Thread/View.aspx?ThreadId=46627 (scroll down), but I can not pass the solution to my problem. Because my installation of the model is completely different.
SchoolclassName is a row property in Schoolclass.cs SchoolclassCodeMonday is a row property in TimeTable.cs ClassCodes aka SchoolclassCodes is a property of type ObservableCollection | Schoolclass |
Does anyone know how to fix my binding?
wpf selecteditem datagridcomboboxcolumn
msfanboy
source share