You can change the Gridview Columns collection in your code. Thus, one way to do this is to remove the column from the current position in the collection, and then reinsert it into a new position.
For example, if you want to move the second column to the first column that you could do:
var columnToMove = myGridView.Columns[1]; myGridView.Columns.RemoveAt(1); myGridView.Columns.Insert(0, columnToMove);
If you need to move them around randomly, you can try to clone the collection of fields, clear the collection in the GridView, and then paste them all in the order you want them to be.
var columns = myGridView.Columns.CloneFields(); myGridView.Columns.Clear(); myGridView.Columns.Add(columns[2]); myGridView.Columns.Add(columns[0]); etc..
I'm not sure if all this will work AFTER data binding, so if there is no reason, I would do it in Page_Init or somewhere before the binding.
source share