Not much to comment, other than what the Title says.
More common in such scenarios are perhaps MS-HFlexGrids,
but those don't support real DataBinding and are slower, because the
Recordset-Data has to be taken over "as a copy" when a HFlex is used.
The VB6-DataGrid on the other hand, is the only "List-Control" we
have in VB6, which is a true "virtual one" (the Data is kept outside the
Control - in an ADO-Recordset - and then only the visible Rows are rendered).
There's a small "Details-Form" which is shown as a ToolWindow (non-modally),
which then follows the currently clicked Record of the DataGrid in the other Form,
"automagically" due to Binding to the same Recordset (over the Text-Detail-Fields
in the other Form).
Thanks to dilettante for his HFlex-based Demo, where I've stolen the Form-Layout for the ToolForm. :)
The one thing one has to keep in mind, when using a VB6-DataGrid in such a "bound mode" is,
that it behaves with much less "quirks", when it's used in "Batch-Mode" - meaning:
- the ADO-Rs has to use a clientside cursor
- and it should be opened with the Flags: adOpenStatic, adLockBatchOptimistic
With that in place, there's not much it complains about.
The other thing not well-known about the DataGrid is perhaps, how to switch it into
true "Read-Only-Mode" (showing full Row-Selections - and never entering its Edit-Cell-Mode):
- set the Grids "AllowUpdates"-Property to False
- lock the Default-SplitView (at Form_Load-Time) with: DataGrid.Splits(0).Locked = True
Then it will look like in the following ScreenShot:
Image may be NSFW.
Clik here to view.
Here's the Demo-Source: DataGridPicker.zip
Have fun.
Olaf
More common in such scenarios are perhaps MS-HFlexGrids,
but those don't support real DataBinding and are slower, because the
Recordset-Data has to be taken over "as a copy" when a HFlex is used.
The VB6-DataGrid on the other hand, is the only "List-Control" we
have in VB6, which is a true "virtual one" (the Data is kept outside the
Control - in an ADO-Recordset - and then only the visible Rows are rendered).
There's a small "Details-Form" which is shown as a ToolWindow (non-modally),
which then follows the currently clicked Record of the DataGrid in the other Form,
"automagically" due to Binding to the same Recordset (over the Text-Detail-Fields
in the other Form).
Thanks to dilettante for his HFlex-based Demo, where I've stolen the Form-Layout for the ToolForm. :)
The one thing one has to keep in mind, when using a VB6-DataGrid in such a "bound mode" is,
that it behaves with much less "quirks", when it's used in "Batch-Mode" - meaning:
- the ADO-Rs has to use a clientside cursor
- and it should be opened with the Flags: adOpenStatic, adLockBatchOptimistic
With that in place, there's not much it complains about.
The other thing not well-known about the DataGrid is perhaps, how to switch it into
true "Read-Only-Mode" (showing full Row-Selections - and never entering its Edit-Cell-Mode):
- set the Grids "AllowUpdates"-Property to False
- lock the Default-SplitView (at Form_Load-Time) with: DataGrid.Splits(0).Locked = True
Then it will look like in the following ScreenShot:
Image may be NSFW.
Clik here to view.

Here's the Demo-Source: DataGridPicker.zip
Have fun.
Olaf