简体   繁体   中英

Infragistics Ultragrid - slow performance with PerformAutoResize

I have badly performing code that uses Ultragrid, but running a visualisation analysis using D3.js on the trace output I discovered that grid__InitializeRow was calling itself multiple times.

Trigger created by: this.grid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(this.grid_InitializeRow);

Problem starts with this code:

column.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, true)

Searching the web I could not find information on this, but have found some possible contenders - calling any of these appears to call initialise row:

  • grid.DataSource
  • grid.Rows.Band.Layout.Bands
  • column.performAutoResize

Questions

  1. Is there documentation on this anywhere
  2. Can I disable the trigger somehow temporarily

Thanks in advance

Found the answer via Infragistics forums :

Calling column.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, true) triggers a rebind from the datasource, which in turn triggers initialise_row .

As the resize was called multiple times (once per column per band) the rebinds got out of hand.

For information we also had the following problems. With a year's data it was taking 2 minutes to render:

  • It was a huge grid and the cells were being styled individually. Changing to using an Appearance library / factory shaved 40s off the load time
  • Database tuning shaved another 40s off
  • Changing the way custom totals rows were calculated shaved 15s off (by using total var instead of updating cell)
  • AutoResize was a force multiplier - made all the other issues worse. Fixing that shaved more time off.

Hope this helps others with simiar problems

I couldn't make "PerformAutoResize" perform adequately. It would take 10s of seconds. So in the end I decided to roll my own, which is limited to our particular use of the grid config which only displays text in cells (as opposed to sub-controls), using the Graphics.MeasureString function for each grid cell.

About 40 lines of code and reduced time taken to 0.4 secs for a 600 x 20 grid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM