FIX: DataGrid Column 1 Visible = False Does Not Work With ADC (223070)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

This article was previously published under Q223070

SYMPTOMS

With the version of the DataGrid that initially shipped with Visual Basic 6.0 (MSDatGrd.OCX version 6.00.8169), a column whose visible property is set to False may appear in the grid if the user clicks on the horizontal scrollbar's thumb.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio 6.0 Service Packs, please see the following articles in the Microsoft Knowledge Base:


194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

MORE INFORMATION

If you're using the original shipping version of the DataGrid (version 6.00.8169), this behavior occurs when the DataGrid is bound to a recordset in any number of ways, such as binding to an ADO Data Control, a DataEnvironment command, or directly to an ADO recordset in code.

Steps to Reproduce Behavior

  1. Create a new Visual Basic project. Form1 is created by default.
  2. Add a DataEnvironment to the project.
  3. Set the DataEnvironment's connection to connect to your database. For example, you could use the Access database NWind.MDB with the Jet 3.51 OLE DB provider.
  4. Create a command on the connection to query a table in your database and add a select statement in the SQL window.
  5. Right-drag the command onto your form and select DataGrid to create a DataGrid bound to that DataEnvironment's command.
  6. Right-click on the DataGrid and select "Retrieve Fields." In order to cause this problem, you must create your query and grid in such a way that the DataGrid displays a horizontal scrollbar. You may need to decrease the width of your DataGrid or use a query that returns more fields.
  7. Right-click on the DataGrid and select "Properties..."
  8. On the Layout tab of the properties page, deselect the Visible checkbox to hide the first column in the grid.
  9. Run the project, and note that the first column in the grid will be hidden..
  10. Click on the thumb for the horizontal scrollbar while the thumb is as far to the left as possible.
If you are using the DataGrid that initially shipped with Visual Basic 6.0 (version 6.00.8169), you will now see that first column in the grid.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbCtrl kbVS600sp3fix KB223070