I have a DataGrid and bound an ObservableCollection to it:
ObservableCollection<Values> MyValueList =
gridViewReceivedValues.ItemsSource = MyValueList;
If I do
the value is added to my collection and because of the binding also shown in the DataGrid.
BUT it adds all my values BELOW all the others, but the newest value should be first.
No problem I thought. My value objects contain a DateTime field on witch i could sort the DataGrid.
But that was not as easy as I thought. After 2 hours of trial and error I still cannot sort the DataGrid.
So my Question is: How do I sort a DataGrid initialy in code?!