can i change the order of my datagrid columns?

i have a datagrid that has some dynamically created columns and some 'hard coded' columns. is there anyway that i can switch the order of columns at runtime?
trevorayAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
gregoryyoungCommented:
yeah, you can just move them in the column collection ...

MSDN:
"Note   The order that the columns are displayed in the DataGrid control is controlled by the order that the columns appear in the Columns collection. Although you can programmatically change the order of the columns by manipulating the Columns collection, it is easier to list the columns in the desired display order."
0
 
trevorayAuthor Commented:
can you show me how or where i can find out how to 'manipulate the Columb collection'?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
gregoryyoungCommented:
win or web ?
0
 
trevorayAuthor Commented:
web please.  c#
0
 
trevorayAuthor Commented:
i am basically interested in placing my 'hard-coded' column at the end of the column collection. but i also don't know how many dynamically created columns there will be, so that might be a problem. i'm sure there isn't something easy that just let's me 'make this column last'
0
 
gregoryyoungCommented:
nevermind I lied ... cant do it ...

Note   Explicitly declared columns may be used in conjunction with automatically generated columns. When using both, explicitly declared columns will be rendered first, followed by the automatically generated columns. Automatically generated columns are not added to the Columns collection.
0
 
trevorayAuthor Commented:
doah!!     :(
0
 
trevorayAuthor Commented:
last thing. can you give me the url that you quoted that comment from? then you'll get an easy 500  :)
0
 
gregoryyoungCommented:
sorry :(
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.

All Courses

From novice to tech pro — start learning today.