Submitted for your approval an UltraWebGrid with CellClickActionDefault=”RowSelect” and SelectTypeRowDefault=”Single” – an ordinary down-to-earth grid. It also posses event handler AfterSelectChangeHandler, also nothing out of the ordinary. But in a minute the aforementioned grid will exhibit properties most unusual. As the alert message ahead reads: Infragistics Bug Continue reading →
Tag Archives: workaround
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:
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.
Elusive “String or binary data would be truncated” error
This was driving me nuts. I have a very basic SQL code similar to
ALTER PROCEDURE Proc1(@val1 NVARCHAR(max)) AS BEGIN -- some code EXEC Proc2 @val2 = @val1 -- some other code END
I was getting error “String or binary data would be truncated”, but only when 2 conditions were met:
- @val1 is quite large
- Either SQL Server/computer just restarted or stored procedure Proc2 was just updated (ALTER)
Error happened just by the fact of the EXEC Proc2 being there it didn’t even had to do anything, it could RETURN straight away. Both @val2 an @val1 are of a type NVARCHAR(max) so there is no reason for the error. The error happened only once, after that I can pass data of any size – and no error would happen. Like I said – nuts. Continue reading →
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:
Solution for WordPress CURL IPv6 error “Network is unreachable”
I am using FeedWordPress plugin on some of my sites to pull data from Google News RSS feeds. It was working fine, but after I moved to a new host, I started to get errors like:
Failed to connect to 2a00:1450:8006::63: Network is unreachable
Note the IPv6. Google have been supporting it for a while and news.google.com resolves to IPv6 first (similar error happens in WordPress admin dashboard in “Incoming Links” section). Unfortunately network of my new host didn’t support IPv6, so I had to find solution to force WordPress to use IPv4. Enter class-http.php. 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:
After some digging I found the culprit. Continue reading →
WebHierarchicalDataGrid: Locate cell by column name
If you need to get/set value of a specific cell in WHDG Row (which is of GridRecord or ContainerGridRecord type) the only way to do it is by Cell index e.g.
Protected Sub xMyGrid_InitializeRow(ByVal sender As Object, ByVal e As GridControls.RowEventArgs) Handles xMyGrid.InitializeRow e.Row.Items(15).Value = 42 End Sub
But what if you don’t know cell/column index and only column name is known? Then the trick is to find the index first. Consider following code:
Protected Sub xMyGrid_InitializeRow(ByVal sender As Object, ByVal e As GridControls.RowEventArgs) Handles xMyGrid.InitializeRow Dim oParent as GridControls.ContainerGrid = e.Row.Items.Grid Dim iColIndex as Integer if oParent.Columns("MY_COLUMN_NAME") IsNot Nothing iColIndex = oParent.Columns("MY_COLUMN_NAME").Index e.Row.Items(iColIndex).Value = 42 End If End Sub
It’s pretty straightforward, first you locate grid to which the row belongs, then locate column in that grid by name and get index of that column and finally locate cell in the row by that index. This method will work at any depth in the WHDG hierarchy.