Das,
To get the last sorted field, you would have to handle the click event
for the column header (you can use the HitTest method on the datagrid to
find out if a column is clicked, and which one, I believe). You do this
^before^ you have the default implementation perform the sort.
What you would do in that handler is get the current DataView and find
out what column it is sorted on. Once you have that, you can call the base
implementation, and then get the new column that is being sorted on.
After that, you should be able to get the currently selected row through
the CurrentRowIndex property on the DataGrid itself (you can then use this
to get the row from the dataview that the grid is bound to).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard. caspershouse.co m
"Das" <Da*@discussion s.microsoft.com > wrote in message
news:29******** *************** ***********@mic rosoft.com...
Hi,
I'm using c# windows application & set the allowsort property to true. I
wanted to know. when user clicks the header of any column the data is
sorted
by that column.
How can I know which is the last sorted field.....
I want to retrieve the currently selected row after the sort....
Thanks in advance...
Regards,
das