Infragistics UltraGrid: The Case of the Out-of-Key Band
We finally took the plunge a few weeks ago, upgrading from 2007 Volume 1 to the latest and greatest, 2008 Volume 2. I was relieved to find that it was an almost pain-free transition.
The only bump that we hit wasn’t even a bug in the current version: it might have been a bug in 2007 Vol 1 that they fixed, or just an undocumented syntax change. The problem occurred in code which identified an UltraGrid band by key rather than index number:
// by key: UltraGridColumn colCode = grid.DisplayLayout.Bands["clsOurObject"].Columns[“codeâ€]; // by index: UltraGridColumn colName = grid.DisplayLayout.Bands[0].Columns[“nameâ€];
Our coding standard was to identify bands by key rather than index number in multi-band grids, in case the grid was reorganized and a band was added or removed.
The UltraGrid band key is read-only, being automatically set by the Infragistics code. When we first started using NetAdvantage in 2006, I noticed that the key for the first-level band was set to the name of the underlying class, but the keys for the child bands were set to the name of the list variable which contained the band’s rows. Strange, but not something that ruined my day. Life went on.
However, after the upgrade to 2008 Volume 2, this eccentricity became a problem. The key names were now all based on the list variable name. After fruitlessly poking around the UltraGrid’s properties and methods for an option that would change things back to the way they were, I gave up and went with the low tech approach of changing all the band key references in our code:
//UltraGridColumn colCode = grid.DisplayLayout.Bands["clsOurObject"].Columns[“codeâ€]; // new key name: UltraGridColumn colCode = grid.DisplayLayout.Bands["lstOurStuff"].Columns[“codeâ€];
We posted the problem to Infragistics’ support forum, and their support team was surprised that our original code had ever worked when using the class name as the key. So, the problem remains unexplained: strange, but still not something that ruined my day.
I haven’t taken advantage of the new functionality yet, but one clear and unexpected advantage from the upgrade is a marked performance improvement in large grids. We have a window which loads massive amounts of data into a two-level grid: sometimes over a million rows. A grid of 200,000 rows which used to take about 30 seconds to load on my development PC (measured from the point that the underlying list was populated until the grid was up and responsive to user input) now takes just 6 seconds. Navigating through this type of large grid and applying sorts and filters is also noticeably faster – sorting the 200,000 row grid takes less than a second, filtering takes about 3. The Release Notes mention some tweaking that Infragistics did to the grid back in Version 2007 Volume 3, but I didn’t expect an improvement on this scale.
A major update with just 1 bug and a huge performance boost: that’s what I call a upgrade!





