Getting DataGrid Sort Column Header Name

  • Thread starter Thread starter DigHazuse
  • Start date Start date
D

DigHazuse

relative noob.

i'm trying to get/display the column Header name that the user clicks
to sort on the DataGrid.

I know that i could take the e.SortExpression and spin through the
Columns on the DataGrid until I found the value that matches the
e.SortExpression and then grab the Header Name ... but I keep
thinking/hoping there is an easier way. I have searched through all
the e.* possibilities hoiping to find the Index # or something that
would tie it together.

any suggestions.

thank you
DIG
 
Dig,

The latest clicked sort of a datagrid is in your underlying datasource

Datatable.DefaultView.Sort property
or
DataView.Sort property

(A dataview is the same as the inbuilt dataview defaultview)

I hope this helps,

Cor
 
Cor said:
Dig,

The latest clicked sort of a datagrid is in your underlying datasource

Datatable.DefaultView.Sort property
or
DataView.Sort property

(A dataview is the same as the inbuilt dataview defaultview)

I hope this helps,

Cor

cor,

perhaps i'm missing something here, but this seems as though this will
just get me the sort expression used and not access to the column name.

I'm trying to get this during my DataGrid SortCommand event.

thank you
dig
 
I thought that you asked for an easier method to get the column. That is in
my opinion the sort expression (with extra Desc or ASC).

Cor
 
Back
Top