Hi,
I have a grid whose datasource is set to a bindingsource whose datasource is set to a c# business object that has some properties, collections, methods, etc.
I set my MaxBandDepth to 1 so that the children don't show up.
I set the datasource of the bindingsource to the single object record that has some of its properties populated.
I set the datasource of grid to the BindingSource inside a button event.
I do not perform any action inside _AfterRowActivate event.
All i see is a grid with ONLY COLUMN HEADINGS and no rows showing up for any columns.
When i do the binding process with another much more complicated business object, then the rows show up properly.
Please help what might be wrong.
Scott.
FYI, when I debug Datasource for the grid, it does show up the rows count and other information.
Most of the column values are 'NULL' however a couple of them are not null. I am sure, these columns too are not shown any value. The grid is empty and has only column names.
FYI,
The object to which the bindingsource is bound to has some collections which have count = 0. Just wanted to share this info.
When I debug the code, before assigning datasource to the grid, I saw the grid already has some empty columns as its datasource. Do i need to clear these? If yes, how? Please specify.
Figured out the solution. I reset the datasource property of the grid to NULL by using the statement as follows:
mygrid.Datasource = null;
The grid now shows the column values happily.