User (Old forums)MemberSeptember 25, 2007 at 11:16 amPost count: 23064
At the moment on the Column class there are SortINdex and SortDirection properties, but they are readonly. Is there anyway i can set the sorting from the code behind.
Imported from legacy forums. Posted by abatti (had 699 views)User (Old forums)MemberSeptember 25, 2007 at 12:36 pmPost count: 23064
I should mention i am binding to an observable list.
Imported from legacy forums. Posted by abatti (had 211 views)Xceed SupportMemberSeptember 26, 2007 at 8:41 amPost count: 5658
You can add SortDescription objects to the SortDescriptions property of the DataGridCollectionView. If you are not using the DataGridCollectionView as a source (which contains your ObservableList) then you can add SortDescription objects directly to the Items property of the grid (which is an ItemsControl).
<a href=”http://doc.xcd/XceedWpfDataGrid/Sorting%20Data.html”>Sorting with DataGridCollectionView</a> (the examples are in XAML, but it should point you in the right direction. Just maje sure you use DataGridCollectionView and not DataGridCollectionViewSource)
Imported from legacy forums. Posted by Jenny [Xceed] (had 314 views)User (Old forums)MemberSeptember 26, 2007 at 10:35 amPost count: 23064
Thank you. This was helpful.
Imported from legacy forums. Posted by abatti (had 263 views)User (Old forums)MemberJanuary 18, 2008 at 2:51 pmPost count: 23064
That link appears to be broken…
I’ve created an event handler for the SortDescriptions but now I want to work with the column that triggered the even but don’t understand how to do this. The event handler is as follows:
protected void SortCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
//TO DO: grab the sort direction for column that triggered event.
Imported from legacy forums. Posted by Jon (had 4419 views)
- You must be logged in to reply to this topic.