I have a grid structure as follows
+ Parent Band |--- Child Band 1 |--- Child Band 2
What I *really* want is a grid that has 2 child bands at the root level. Seeing as this is impossible I've created a data structure that has 2 bands inside a single parent, and added a dummy row to my data structure to contain two IBindingList's, one for each Child band, both belonging to the same parent.
Display wise, what happens, of course, is that there is an empty row at the top of the grid then two child bands as expected. I've been trying ways of getting the parent row to be hidden, or essentially 0px high while keeping the child bands visible. If I set Row.Height = 0 (/1/2/...), it seems to have no effect (RowSize mode is set to Free). Hiding of course hides the child bands.
Is there any way that I an achieve the effect I'm after without having to resort to multiple grids?
Hi Mark,
The row height most likely doesn't do anything because the MinRowHeight is set. Set MinRowHeight before setting the Row height and you can probably reduce the row height to 1 pixel. I'm not sure if 0 will work, but give it a shot.
If 0 doesn't work, then you could still hide the 1-pixel row using a CreationFilter to remove the RowUIElement.
Hi Mike,
Setting the minRowHeight to 1 helped a lot, but as you anticipated didn't remove the row entirely. I also implemented a creation filter to remove the element but the space it would have taken up wasn't reclaimed by the other controls.
I tried altering the rect's of all other elements to shift them up but this ended up generating a stack overflow exception, which is a bit odd.
Either way, the small amount of empty space above the first band header is an acceptable solution for the moment. If I could figure out how to properly shift up the other elements of the grid that would be icing on the cake.
Regards,
Mark