I have a sharepoint link list.I am programattically displaying items of the link list in the SPGridView.
I am using following code to read the list
SPList spList = myWeb.Lists["MyListNameHere"];
and assign the SpList as the datasource of SPGridView which display items as is.
But i want to display items in SPGridView in the same order as they are set through List Tool > Items > Change Item Order
Order of SPGridView items should always reflect the current order set in the link list items.
How can this be achieved ?
The order is stored in a hidden column named Order.
Use SPDataSource control as your data source, set the listID to your list and set the select query to something like:
That should do it