Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
830
How To Stop Child Rows Being Loaded
posted

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

 

Parents
  • 469350
    Offline posted

    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.

Reply Children