If I fill a dataset via tableadpaters with several tables and their schema and assign the dataset to a bindingsource, is it possible to give the bindingsource to the grid datasource and one of the table names to the grid datamember and have it automatically show the hierarchy of the tables assuming the proper constraints and tables were defined? I can do this with a typed dataset sample but notice the grid wizard defined all the bands. In the code where I would like to get the grid to work in a hierarchial fashion, I am using a regular dataset and am not defining bands as I do not necessarily know how many there on a given table and would rather have the grid figure that out rather than have to do it in my code. Is this sort of thing possible or must I define all the bands? Thanks, Dave
Hi,
I'm sorry, but I'm not really clear on the distinction you are making.
If you bind the grid to a DataSource, the grid will automatically read the data structure from that data source and build all of the bands and columns as provided by that data source. You do not have to set up any bands in the grid manually. Is that what you mean?
Yes. I now found the SetDataBinding method so use it instead but I still am getting no bands, just the top level datatable. Here is what I do:
myBindingSource.DataSource = myDataSet;myGrid.SetDataBinding(myBindingSource, myDataTableString, false, false);
and cannot drill down to any child tables. Is there something else I need to set to allow the hierarchical display? This works if I let the wizard do everything against this same data in a test sample. I have added the data and schema to the dataset so all the relations are there.
Thanks, Dave