views:

585

answers:

2

How can i arrange columns in asp.net gridview? i want to change 4 columns' location. ForExample:

column1 | column2 | column3 | column4 |

ChangeOrder()

column2 | column1 | column3 | column4 |

ChangeOrder()

column4 | column2 | column3 | column1 |


I want to move columns in Gridview.

A: 

I don't know if this is an option for you, but the Telerik RadGrid supports this. See this online demo for details.

M4N
A: 

2 options from the top of my head:

  1. Turn AutoGenerateColumns off and add the columns yourself, mapping them to what you want in the dataset and in the order you want them.

  2. Change your SQL query to return the columns in the order that you want.

JohnIdol