Hi,I am using UltraGrid 10.1.2 and the code below to bind it to a list of custom objects. If I change the MaxBandDepth to be 1 it is quick so it must be opening up the child bands even though I have Loadstyle set to LoadOnDemand, this is confirmed when I trace it and can see that on the line this.bLDepartmentUltraGrid.DataSource = bLDepartmentBindingSource; the code is going into one of the child objects.
Is there a way to stop the code getting the child data until the uses selects that child ? I was hoping the that LoadOnDemand would have done this
this.bLDepartmentUltraGrid.DisplayLayout.LoadStyle = LoadStyle.LoadOnDemand;this.bLDepartmentUltraGrid.DisplayLayout.MaxBandDepth = 3;this.bLDepartmentBindingSource.RaiseListChangedEvents = false;this.bLDepartmentBindingSource.DataSource = AllDepartments;this.bLDepartmentUltraGrid.DataSource = bLDepartmentBindingSource;this.bLDepartmentBindingSource.RaiseListChangedEvents = true;
Thanks John
Hi John,
I'm confused by what you are trying to do.
Do you want your grid to load the child bands or not? You seem to be saying that you DO want the grid to show the child data, but only after the user expands a parent row. But in that case, setting MaxBandDepth to 1 will not work, because this will prevent the grid from ever loading any child data.
In any case, if your child data is being accessed before a parent row is expanded, it might be just because the BindingManager in DotNet is trying to get the data structure so that the grid can build the bands. There is no way to prevent that, but it should just be a single row, so it's really not a big deal.
Hi Mike,
Yes apologies I wasn't clear. The reason I mentioned setting MaxBandDepth to 1 (which made things very quick) was to prove that the grid must be doing something with the child bands as when I set MaxBandDepth=3 it was a lot slower. The difference in time is instant when MaxBandDepth=1 to about 6 seconds with MaxBandDepth=3. But yes ultimately I need MaxBandDepth to be 3 so that I get the child bands
Ideally I would like the grid to do nothing with the child bands until the User tries to expand one but you say this is not possible, can you confirm that this is the case even with later version of the grid
Also I think that my performace problem lies in the fact that my objects are deep and complex and recursive so possibly the binding manager ends up doing a lot of work to discover the structure when MaxBandDept=3. I dont suppose there is anything I can do to improve this