Search code examples
c#ultrawingrid

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


Solution

  • 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.