For a datagrid with AutoGenerateColumns set to true.

Is there a way of getting the index of the column when a SortCommand event
is raised?
What I'm trying to do is, change the background color of the column based on
the column that is used for sorting.
So i need to get the index in the sortcommand event.



Any help is appreciated.