Category Archives: Infragistics

WebHierarchicalDataGrid: Extra Row after Update

If after upgrading to a new version of Infragistics NetAdvantage you suddenly found your WHDG sprouting an extra blank row on top:

Extra Row in Aikido WHDG

most likely it’s because grid’s ItemCssClass property is used. In theory (at least according to ever so verbose documentation) it should define what grid’s cells look like. In practice it have no effect whatsoever. Or rather had no effect until upgrade (verified in version 2011.1, perhaps even earlier). Now if your CSS class used in this property contains HEIGHT attribute – a blank row of that height will be inserted on top of the grid.

Solution? Remove ItemCssClass property. It’s useless anyway.

WebDataMenu: Incorrect displaying after upgrade

This is the second post in saga titled Upgrading Infragistics Controls to a new version. Chances are that your WebDataMenu looks weird after upgrade to 2010+ version. In my case the menu had following options/features:

  • It was a context popup menu, called on right mouse click
  • Text of menu items was assigned dynamically at runtime in JavaScript Client code

After upgrading NetAdvantage from version 2009.2 to 2011.1 strange things started to happen. Text of the menu items was cut short, submenues appeared at wrong places it looked like something from a Dali’s painting.
Numerous experiments later I found out that the problem was with EnableScrolling property of the menu control. Setting it to False returned menu to realm of realism.

WebHierarchicalDataGrid: JavaScript errors after upgrade

Upgrading 3rd party library to a new version is bound to have problems and Infragistics is no exception. In my case I was upgrading NetAdvantage for ASP.NET from version 2009.2 to to 20011.1 and right away WebHierarchicalDataGrid started to crash client-side. If ScriptManager was in debug mode I’d get error:

Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.Parameter name: type

With ScriptManager in Release mode it’d be:

Microsoft JScript runtime error: Object expected

But always in Sys.Component.Create – it looked like grid’s client-side scripts weren’t loading at all. After A LOT of digging I found out that the culprit was grid’s server-side Bands.Clear() method. When called, it caused client-side WHDG JavaScript not to load. When that method was commented – JavaScript errors disappeared. So until Infragistics comes out with a bug fix – if you experience similar problem, try to avoid Bands.Clear() method.

WebHierarchicalDatagrid: Sys.ArgumentException: Cannot deserialize on Row Expand

I have been using WebHierarchicalDataGrid with manual load on demand bands with a pretty good success until I hit this snag.

The WHDG has correctly displayed HTML fields before, but this time a column with HTML data (an HREF link to be precise) is needed as one of the grid’s DataKeyFields to provide uniqueness of the row:

WHDG with HTML column Continue reading →

Solution for UltraWebGrid missing scrollbars

I was working with classic Infragistics UltraWebGrid when noticed strange thing – even though scrollbars were enabled for the grid, the grid had fixed size and number of rows was bigger than the grid could display – no scrollbars appeared. For me it was a combination of grid being shown in a modal dialog in IE7 browser, but it could happen in other scenarios.

I also noticed when grid experienced any kind of user interaction (row added, row selected, checkbox cell checked etc.) scrollbars would magically appear. So the solution? Simulate user interaction. For example this code can be included in grid’s client-side InitializeLayout event:

function xMyGrid_InitializeLayout() {
    var oGrid = igtbl_getGridById('xMyGrid')
    oGrid.Rows.getRow(0).setSelected(true);
    oGrid.Rows.getRow(0).setSelected(false);
}

What happens here is first row of the grid is selected and an instant later unselected. It happens so fast that there’s no visual indication. But the grid gets its “user interaction” and scrollbars appear.

Server-side “PageIndexChanging” event in UltraWebGrid

When Infragistics UltraWebGrid is not in LoadOnDemand mode, you need to rebind the grid to the data source in PageIndexChanged event for paging to work. What’s neat – before the rebind, grid is still on the old page, effectively giving you “BeforePageIndexChanged” or “PageIndexChanging” event in server-side code:

Protected Sub xuwgGrid_PageIndexChanged(sender As Object, e As UltraWebGrid.PageEventArgs) Handles xuwgGrid.PageIndexChanged

   'Page hasn't changed yet, collect data from the old page
   'Or cancel the rebind and remain on the old page

   'rebinding the grid to the datasource
    BindGrid()

   'New page is in effect

End Sub

Affecting page during WebDataGrid AJAX calls

When Infragistics WebDataGrid perform AJAX operations such as sorting and paging – it sends grid data directly to page’s DOM. But it also allows you to send your own custom data via server-side GridResponse object and its client-side counterpart. This feature allows you to establish effective link between server and client to perform custom operations otherwise available only during full postback or partial postback via update panel. There’re multiple cases where this can be used, let’s take a look at 3 most common:

  • Updating a related control with server-side generated data
  • Running a server-side generated JavaScript
  • Handling server-side errors, for example Session timeout

Continue reading →

Implementing getNextRow in WebDataGrid

UltraWebGrid had a very convenient getNextRow() client-side function which returns next row in row collection. WebDataGrid does not have an analog, but it’s pretty easy to recreate the functionality:

function getNextRow(i_oRow) {
      var iRowIndex = i_oRow.get_index();
      var aRows = i_oRow.get_grid().get_rows();

      return aRows.get_row(iRowIndex + 1)
}

This function accept grid row as a parameter, gets the row’s index and return row with incremented index from grid row’s collection.

Solution for ‘previousSibling’ is null or not an object error in grouped UltraWebGrid

Infragistics UltraWebGrid offers standard keyboard navigation for record selection. For example you can click a row, and holding Shift key press Down Arrow to select multiple records. This works fine for a flat grid, but try this with grid in OutlookGroupBy mode and you’ll get an error ‘previousSibling’ is null or not an object:

Error selecting records in grouped UltraWebGrid

After some digging I found the culprit. Continue reading →

Infragistics supports good old traditional values

Good news everybody, according to Infragistics product Roadmap, upcoming NetAdvantage 2011 Release will support Windows 3.0/3.1

Infragistics on Windows 3.1

Finally cries of countless developers who code on Intel 386 machines with 16Mb of RAM have been answered. There’s no more need to look with envy at those fancy 32bit OS-es – things like charts, gauges and grids (pictured below is a Windows 3.1 implementation of WebDataGrid with running totals and custom slider control) are available to everybody.

Infragistics WebDataGrid on Windows 3.1

Infragistics is known for innovations and being on the cutting edge. Kudos for not forgetting what got us there.