One thing that is tripping up some people who are upgrading their VS 2003 Datagrid code to use the VS 2005 GridView is that invisible columns can no longer be used for passing data around. Polita Huff explains the reasoning behind that change (for security reasons) here.
There are (at least) 2 workarounds for this issue, if you've depended on this functionality in the past.
1) If you're using invisible column data before a PostBack to determine something, say, during the ItemDataBound event, you can just use the DataItem property of the Item you're working with.
Old code:
If CType(e.Item.Cells(7).Text, Boolean) Then
e.Item.Cells(3).Text = "Owner"
Else
e.Item.Cells(3).Text = "Not an Owner"
End If
Change to:
Dim drv As System.Data.DataRowView = CType(e.Item.DataItem, System.Data.DataRowView)
If CType(drv("IsOwner"), Boolean) Then
e.Item.Cells(3).Text = "Owner"
Else
e.Item.Cells(3).Text = "Not an Owner"
End If
2) If you need that invisible data after a PostBack, use the new DataKeyNames property of the GridView (similar to DataKeyField in ASP.NET 1.1, but it now supports multiple columns). Note that when you use DataKeyNames, the page will automatically decide to encrypt your ViewState (ControlState) to help protect those values, as it assumes your primary key data is potentially secure information.
-- Marcie