I have some problems with DataGridComboBoxColumn. The first issue is that I do not see “default” value after loading data grid and I have to select it manualy from list. But when I select value it’s correctly saved in my log file. The second issue is when I want to display this data from saved log file.
In the Obersvable collection it’s correctly parsed but in DataGridComboBoxColumn value is not shown.
Here is my approach (yes I know it’s not correct…):
XAML:
<DataGridComboBoxColumn x:Name="sCurrentStatus" Header="Current Status"
SelectedValueBinding="{Binding sCurrentStatus, Mode=TwoWay}"
DisplayMemberPath="{Binding sCurrentStatus}" />
</DataGrid.Columns>
code behind :
sCurrentStatus.ItemsSource = viewModelProjectTestsDescribed.listOfStatuses;
viewModelProjectTestsDescribed.createTestsDescribedLogFile();
observableCollectionListOfProjectTests = new ObservableCollection<ViewModelProjectTestsDescribed>();
observableCollectionListOfProjectTests = viewModelProjectTestsDescribed.readTestDescribedLogFile();
dgProjectTests.ItemsSource = observableCollectionListOfProjectTests;
in the “dgProjectTests” after all all values are correctly set and shown in DataGrid except the “Current Status” one.