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

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to