|
-
Aug 13th, 2010, 04:57 AM
#1
Thread Starter
Member
-
Aug 13th, 2010, 08:51 AM
#2
Re: Datagridview Column Order Problem
Step through the program to see where (if it is consistent) it changes the columns. That will give you more information (if it is inconsistent, that is still information, but not as helpful).
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
-
Aug 13th, 2010, 10:01 AM
#3
Thread Starter
Member
-
Aug 13th, 2010, 10:09 AM
#4
Re: Datagridview Column Order Problem
Does this happen every time? For example if you press F5 (or click run) but do not do anything and immediately click stop, does it happen then? If you must do something then set your app up so you do not have to do anything. This will help you determine what is causing it. You can also make a new form, add a grid, add columns and see if it happens there.
A fix that doesn't solve the problem would be to set the columns in code, a preferred method anyway.
Try the above steps and post your results so we can narrow it down.
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
-
Oct 1st, 2013, 11:22 AM
#5
New Member
Re: Datagridview Column Order Problem
I set the order in code. Use the UI to create and place the DataGridView. Once in code,
dgvCustomers.Column("FName").DisplayIndex = 0
dgvCustomers.Column("LName").DisplayIndex = 1
Then the problem becomes that the order does not always work. The following article explain how to fix that:
http://www.internetworkconsulting.ne...er-not-working
-
Oct 1st, 2013, 11:32 AM
#6
Re: Datagridview Column Order Problem
It is only when I exit the application that the order has changed.
And if you don't mess about changing the order in the meantime what happens if you run the program again? And again? And again? If the columns are in the correct order every time the program runs irrespective then I'm really not sure why you have a problem with it!
In any case, how do you expect us to answer such a problem without benefit of code related to DGV, the design time properties or even a screen capture of the DGV at its various stages. We're just blundering about in the dark at the moment.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Oct 2nd, 2013, 10:01 AM
#7
Thread Starter
Member
Re: Datagridview Column Order Problem
 Originally Posted by dunfiddlin
And if you don't mess about changing the order in the meantime what happens if you run the program again? And again? And again? If the columns are in the correct order every time the program runs irrespective then I'm really not sure why you have a problem with it!
If the column order was OK everytime I would not have posted. I was not changing the order, in-code or using the UI. The design-time column order of the DGV was different after debugging to what it was before I had played the application. i.e. on-screen design time order - 1,2,3,4 >>> Debug/play the application >>> Do nothing/close the app >>> on-screen design time order 3,1,4,2.
In any case, how do you expect us to answer such a problem without benefit of code related to DGV, the design time properties or even a screen capture of the DGV at its various stages. We're just blundering about in the dark at the moment.
You're only 3 years to late so I am not expecting you to do anything.
The reason I did not post any code was because the problem was only occurring at design time. Run-time code would not have affected this. I would of provided screenshots and code should someone answering the question have asked.
I put it down to my project solution files and VS2008 as it didn't occur in 2010. Closed.
Please mark your thread as Resolved; it helps identify which posters still require assistance and keeps things nice & tidy 
Acknowledge a helpful post; keeps the community going 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|