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
135
Adding new bands and columns dynamically causes super slow speeds
posted

Hi,

We have a hierarchical UltraGrid that is bound to an UltraDataSource, which is in turn based off a hierarchical data structure of objects.  When creating a new band for the UltraDataBand (and hence UltraGrid), we have a function that will reflectively loop through an object's type, get the appropriate properties, and then create columns based on those properties and their return types.

When building the grid for the first time, it works great. However the structure can change based on changes the user has made in other forms, and so rather than rebuilding the whole grid each time, we simply work out how the grid should change and add UltraDataBands and UltraDataRows so that those changes are reflected in the grids. 

All this runs through exactly the same functions as the original 'bulk' load. However for some reason, adding columns to UltraDataBands once they have already been created like this takes A LOT longer.  E.g. when building the original 5 band deep tree it takes 23 millisecs to create the columns.  When trying to add 3 bands to the same grid, it takes 17543 millisecs.

I can't seem to track down why it is so much slower. Is it because there are events being thrown once the grid is displaying?  I tried setting the EventManager.AllEventsEnabled to false but that didn't seem to make a difference.

Thanks, Dane.