Problem Description: Set the ComboBox control in the DataGrid and bind it to the corresponding data, if the newly added line is already set the value of the field, then it will be displayed in the ComboBox control, but append a blank line in advance, and then set the value in the data corresponding to the row, The corresponding data is not displayed in the ComboBox control.
This problem tortured me for several days, try to Itemsource to initialize the binding before it, no, the binding element type changes also not, finally in StackOverflow, a reply to the point of waking me: you should raise the PropertyChanged event on the Hourlyrates property after populating the list in the Foreach loop. Also, set the Mode of the ComboBox SelectedItem binding to TwoWay.
So I set the value of the binding mode to TwoWay after the execution of a bit, the data show out!!!
Record it for forgetting.
Data from the ComboBox in the DataGrid shows