Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys, I have a datagridview which have more than 1 column(50+), in the same datagidview I also fill it from database data so it will add another column(2). Now, everytime i connect it to the database the column from the database displayed at the last. I want it to be shown in the first, how can I do this? Any help? Sorry for my english.
Posted

1 solution

One way is to use DisplayIndex[^] property to reorder the columns.
 
Share this answer
 
Comments
J3ssy Pmntra 1-Aug-14 21:23pm    
How can I do that ma'am? Sorry but I'm new in programming. Do you have some example?
J3ssy Pmntra 1-Aug-14 21:24pm    
How can I do that sir? Sorry but I'm new in programming. Do you have some example?
Wendelius 2-Aug-14 1:03am    
The example in the documentation shows how to swap the first and the last columns. The same way you can define the position of any column.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900