Hi Greg Is this useful?
http://social.msdn.microsoft.com/Forums/en/wpf/thread/b9059d29-d00c-4756-b26 0-7e4d74984b93 Kirsten _____ From: [email protected] [mailto:[email protected]] On Behalf Of Greg Keogh Sent: Sunday, 26 February 2012 6:53 PM To: 'ozWPF' Subject: Sorting a DataGrid Folks, I have a DataGrid with the items source set to an ADO DataView. I have to detect when the grid is sorted by the user clicking on a column header, then remember the column and the direction so that I can restore the sort state when the app next starts. I'm tackling part one now: detecting and saving the sort state change, but it's not as easy as I thought. The grid Sorting event runs before the sort happens, so it's too early to get the state. I can't find any kind of "column header click" event or similar thing that might be useful like we have in the WinForms grid. I had a look at ADO DataView and DataTable events but I can't find anything useful there either. I did see that sorting the grid causes it to silently set the Sort property of the view, which I never noticed before. So I can see values like "[MyFoo] DESC" magically appearing in the property. Perhaps using a DataView is not the best choice. I'm guessing there are other components I can put between the items source and the grid that might be more helpful, but I'll have to take some of my WPF books to bed for a refresher course. Anyone have a quick bit of advice? Greg __________ Information from ESET NOD32 Antivirus, version of virus signature database 6869 (20120208) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
_______________________________________________ ozwpf mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf
