Click to See Complete Forum and Search --> : Question on FlexGrid in a splitter window


PhilDoe
August 4th, 1999, 03:26 PM
Hey everybody,

I'm having a little problem with the MS Hierarchical FlexGrid Control(6.0) bound to a datasource when my app uses a splitter window.

Here's what I can do to easily recreate the problem:
_I made a simple, one-table database in Access2000
_Run AppWizard in VC++6 with following options:
___Single Document
___Windows Explorer type project (instead of MFC standard)
___Change the view base class to CFormView
_These options will create a two-pane app with a CTreeView on the left and a CFormView on the right.
_On the form view, insert an "MS ADO Data Control 6.0"
___Use a datalink file (using ole db) which points to the database made earlier for the db connection
___select 'adCmdText' for RecordSource with "SELECT * FROM [Table]" as SQL statement
_Now, insert the Hierarchical FlexGrid Control
___Set DataSource to previously created ADO Control

OK, everything is set up now. This is what happens... First of all, I can view the form using the Test option (CTRL+T). This works fine, all the database records are in the grid. However, when I compile and run the app, I get runtime errors all over the place, mostly coming from 'winsplit.cpp' which is not my source. It's the source for the splitter object. And I haven't changed anything in my program other than adding two controls!

Another thing, set the grid control to 'not bound to datasource' and the problem goes away, but this doesn't help my plans too much since I need the database.
I have noticed that every ADO bound control (ie. datagrid, datacombo) has the same errors at runtime if bound to a datasource and used in a splitter view.

Also, another catch. If I create a new app using the 'MFC Standard' option in appwizard with 'CFormView' as the base view class, and add all the controls, everything works fine.

Ok, enough said. I hope I elaborated enough.

Any ideas on how to get the bound grid control to work correctly when using a splitter?

Thanks,
Phil