Setting SortDirection has no effect

Oct 6, 2008 at 12:30 PM
Hi,$0$0$0$0 I want to sort a grid programaticly. (it workes fine if I just click on the column header)$0$0$0$0$0 I use this code Grid.Columns[0].SortDirection = ListSortDirection.Ascending$0$0$0$0$0 The values gets set, but unfortunatly there is no visual feedback.$0$0$0$0$0 Any guess on this one ?$0$0$0$0$0Regads,$0$0Calin$0
Oct 6, 2008 at 11:32 PM
To sort programmatically you have to do more than update the SortDirection.  If you want to copy the functionality of the default sort when clicking a column header you have to clear the Items.SortDescriptions and add a new SortDescription with the column's property that it's bound to in addition to setting the SortDirection.  Take a look at the source code in DataGrid.DefaultSort().
Oct 7, 2008 at 9:01 AM
Hi vinsibal$0$0$0$0 I took the time to look at the code and see you point.$0$0$0$0$0Thank you,$0