We've got an old VB6 application we wrote about 10 years ago. Back then we had no faith in data binding, so we did all of our own population of controls in code. (Long story, don't ask.) This application is one of our primary apps, so it gets used heavily. Back then, we purchased third party controls for various things, one of them being a replacement for the grid control that came with VB6. Recently one of the forms in this app has started to occasionally give problems. Because we handled the population of controls in code, we assigned column headings to all of the SSDBGrid 3.0 controls in the VB6 IDE. The form that occasionally gives problems has 2 columns with the proper headings, in the VB6 IDE. However, when it gives trouble, then there is only 1 column with a heading of "Column 0". It is almost as if the control is being re-initialized, but I'm not certain of this.
What would cause those old Sheridan SSDBGrid controls to do this?
Posted: December 2, 2009 at 4:01 PM by: Rod
When the application is run from the IDE then the column headings are displayed correctly?
When the application is run from the exe then the column headings are sometimes not displayed correctly?
When you load the form at design time, are the column headings being loaded?
The main factors to consider are:
At what point is the code that sets the column headings being called? Form_Load, Form _Initialize, outside the form?
Are any references made to the grid before the form loads, or immediately after it is displayed?
At what points are Rebind and Refresh being called?
I have seen this happen before and it ended up being a sequencing issue. Most likely the grid is being referenced by code at the wrong time.
As a brutal resort, have you tried deleting it from the form, saving, and replacing it? (and referring to a backup file to reinstate property settings)
On December 6, 2009 at 11:33 PM by: CMH