• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

DataGrid Sorting

Is there any way to determine what column a datagrid is sorted on given only the datagrid and the datatable.  Ex. I have a datagrid that is using a datatable as a datasource.  The user clicks on a column header to sort the datagrid.  When the datatable is refreshed, the datagrid goes back to the default sort order.  At the time I go to refresh the datatable, is there any way I can determine the current sort order?????????
0
gvector1
Asked:
gvector1
2 Solutions
 
evilrixSenior Software Engineer (Avast)Commented:
Isn't the idea that you bind the grid to a DataView and it's the view that holds the state, including the sort criteria?

http://msdn2.microsoft.com/en-us/library/system.data.dataview.aspx
0
 
vbturboCommented:
picking up on evilrix (sort criteria defined)

try read this PAQ
http://www.experts-exchange.com/Programming/Languages/.NET/Q_21095550.html

vbturbo
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now