Ihave an UltraGrid which is populated form a collection of Custom objects where each object in the collection is a custom object called BLDepartment which itself contains properties of custom objects within it. The code to do this is:
this.AllDepartments = BLDepartment.GetDepartmentsFromManagerPersonId(BLPerson.LoggedOnPerson.PersonId);this.bLDepartmentBindingSource.DataSource = AllDepartments;this.bLDepartmentUltraGrid.DisplayLayout.LoadStyle = Infragistics.Win.UltraWinGrid.LoadStyle.LoadOnDemand;this.bLDepartmentUltraGrid.DisplayLayout.MaxBandDepth = 3;this.bLDepartmentUltraGrid.DataSource = this.bLDepartmentBindingSource;
The code hangs for a very long time (about 3 minutes) on the last line. I assume this is because as the grid is binding to the collection, it is going into evey public property of every BLDepartment object in the collection. If this is the case is there a way to stop this hapenning and so improve performance ?
Any help greatly appreaciated.
John
Hi John,
jvinnell said:I assume this is because as the grid is binding to the collection, it is going into evey public property of every BLDepartment object in the collection.
No, I don't think so. The grid doesn't do that. I will loop through all of the rows at the root level, but it's not going to access every property. My guess would be that your MaxBandDepth is somehow getting reset and the grid is, in fact, walking down beyond level 3. Try checking the MaxBandDepth property after you set the DataSource to see if it's still set to 3.
If that's not the issue, then I'll need more information. If you could post a small sample project demonstrating the issue, that would be the best thing and I could tell you exactly what's taking so long.
If not, then the structure of the BLDepartment would be helpful. Also, the number of rows in the list would be good to know.
Mike,Thanks for pointing me in the right direction. When I set MaxBandDepth=2 I see 4 bands when I look in the designer and performance is fine. When I set MaxBandDepth=3, which I need to do to get one of the bands I need, I see 47 bands in the designer and performance is bad.
I actually only need 1 parent and 2 child bands so is there some way to remove the unwanted 44 bands or stop them being read insome way ? Or only bind the 3 collection properties in my BLDepartment object that I need to the grid.
Thanks John