Reputation: 4663
I have a DataGrid and I want to specify that a column is sorted by default. Using the SQL sort is not working as intended, but when I click the column header it sorts exactly as intended. I just want it to do this by default.
Upvotes: 0
Views: 203
Reputation: 39767
Assuming you're talking about GridView you can use GridView.Sort method to sort the grid programmaticaly. E.g.
MyGrid.Sort("MyColumn", SortDirection.Ascending)
Upvotes: 1