I have a multiband grid where I want to create child bands when the expansion indicator is selected on the parent band. I put code to do this in the BeforeRowExpanded event but the expansion indicator disappears like there is no child data. I am manually creating records in the dataset that is bound to the grid. do I have to refresh the grid maybe?
Hi,
I would advise against this. The grid is really not designed to handle dynamically added and/or removed bands.The grid's data structure has to be homogenous, so it's more efficient and easier to set up the band structure up front.
Having said that, what you probably need to do is call grid.Rows.Refresh to force it to reload the data.
my post may have not been very clear...
the datasource structure for the grid is static - all I am doing is adding data to the datasource when the beforerowexpand grid event fires. The refresh method works fine and I got it working, sort of.
One problem that I haven't been able to solve is that if the first row that I attempt to expand is the first row in the grid, the expansion indicator disappears like there was no child data. If I click to expand another row and then click to expand the first row, it works correctly. In both cases, the child data for the first work is build properly.