By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,483 Members | 1,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,483 IT Pros & Developers. It's quick & easy.

Getting DataGrid Sort Column Header Name

P: n/a
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

Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Nov 17 '05 #2

P: n/a

Cor Ligthert [MVP] wrote:
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

Nov 17 '05 #3

P: n/a
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

"DigHazuse" <di*******@msn.com> schreef in bericht
news:11**********************@g49g2000cwa.googlegr oups.com...

Cor Ligthert [MVP] wrote:
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

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.