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
750
ultragrid perf issue adding and removing columns
posted

Hi,

 

I've searched a little bit in this form and can't find a clear match.

I'm dynamically adding and removing columns from the datasource backing a grid.  I am experiencing huge delays. I've tried using SuspendRowSync, SuspendLayout and SuspendCalc properly contained within a BeginUpdate and try finally block with an EndUpdate (I didn't forget the appropriate Resume call).  However none of these alleviate the performance problem.

I looked at the Grid Performance Guide and nothing jumped out at me.

I've used the Red Gate performance profiler to track down the performance issue. See attached compressed  file that contains the call graph locked at the function occupies 89% of the time. In that function, it spends a majority of the time in Add/Remove columns on the UltraDataSource. Also it's clear that it's triggered a recalc and the recursive descent parser is parsing the calc code for the grid.

How can I improve the performance here? Perhaps I misapplied SuspendCalc? Can I force the CalcManager to fire once and statically create the code for the computations  and not recompute them again?

 

Any suggestions are appreciated.

 

Craig

 

add-remove-columns-perf.zip