I have been trying to find the right order to assign the data source to a grid, but regardless of which order I use, it seems to be creating many more bands than the MaxBandDepth. The data source is LINQ to SQL with 141 tables.
I have tried: 1. setting MaxBandDepth to 5 and then set the DataSource on the BindingSource with the BindingSource already assigned to the Grid. 2. setting MaxBandDepth to 5 and then set the DataSource on the BindingSource without the BindingSource assigned to the Grid, then assign the BindingSource to the Grid.
It is generating 100 bands in some instances and over 1000 when I tried option 2. Also, when the data source is changed after the bindings have been set, it ignores the MaxBandDepth and regenerates all the bands again.
Is there a bug in 2010.3? Or is there a way to make the MaxBandDepth function correctly all the time.
I forgot to mention that changing the MaxBandDepth to anything after the first time does not seem to cause the grid to regenerate the bands. I would be willing to set it to 1 and then change it to a larger number, but it doesn't work.
Hi,
Are you doing this at design-time or run-time?
What version of the grid are you using?
MaxBandDepth is not designed to be changed on-the-fly. It's pretty much a set-once kind of property. So usually, you would set it at design-time before assigning the grid's DataSource and that's it.
Also note that it only enforces a maximum depth, not a maximum number of bands. So if you set it to 2 and you bind the grid to a table which has 100 child relationships which are siblings of each other, you will still end up with 101 bands.