Daily Archives: 04/20/2010

Selectively change cell type in Infragistics UltraWebGrid

When you design columns for UltraWebGrid, one of the settings available to you is Column Type. For example you can set it to Button, and all cells within the column will render and behave as HTML buttons. Other options available such as Check Box or Hyperlink.

But what if you want some of the column cells to be of a different type? For example some of cells aren’t supposed to be links, but plain text instead? The solution is to set Column Type of those cell thru code. Consider following example:

Protected Sub xmyGrid_InitializeRow(ByVal sender As Object, ByVal e As RowEventArgs) Handles xmyGrid.InitializeRow
    If e.Row.Index > 0 Then
        e.Row.Cells.FromKey("LINK_CELL).TargetURL = "http://mysite.com?ID=" & e.Row.Cells.FromKey("LINK_ID)
    Else
        e.Row.Cells.FromKey("OBJ_NAME").Column.Type = ColumnType.NotSet
    End If
end sub

Above is a handler for UltraWebGrid’s InitializeRow event. It checks if a row is a first row in the grid and if so – sets its column type to “NotSet” effectively removing “Hyperlink” type set at design time. And even though it references type of entire column – the change applies only to the current cell.

IE8 Idiotic Session handling

As you may be aware Internet Explorer 8 will share session among its different instances (even if you start new instance by clicking IE Desktop icon). Why on Earth this was done is described in this article. The only way to start a new session is to use obscure File -> New Session option in menu, interesting choice, considering that in IE8 menu is hidden by default.

But this is not the end. Quoting the article:

Relying on closing the window to clear the session is not a recommended way to implement proper logoff for an application. Because this clearly will not work if there is another window that is sharing the session.

True, buy why, pray say, session isn’t cleared for one application if its window closed, but another window remains open, pointing to a completely different application, on different server in different DOMAIN?!

Do try this:

  1. Login to any app that that requires user login.
  2. Open a new browser, and point it anywhere to a completely unrelated link.
  3. Close original app window from Step 1.
  4. Open new browser window and go URL of app from Step 1.
  5. Surprise, surprise, you’re still logged on.

Also, aren’t  they aware that 99.9% of all users will simple close browser window instad of going thru logout process even if it takes only one click? And in many scenarious, including one above user will stay logged in.