asp.net + datagriditem is not defined

I am working with a datagrid, and am tyring to using sorting, i have completed this without problems in other projects, but the following line of code is coming up with an error, i am sure i am missing something simple, but can not seem to find it.

Dim dgitem As DataGridItem (error -  datagriditem is not defined)

also

Dim dtGrid As DataGrid = source (error - datagrid is not defined)

Thanks
dkilbyAsked:
Who is Participating?
 
laotzi2000Connect With a Mentor Commented:
You should imports name space System.Web.UI.WebControls
Imports System.Web.UI.WebControls

Both datagrid and datagriditem are in this namespace
0
 
b1xml2Commented:
Because option strict is set to on

URL for your consideration:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmOptionStrict.asp
http://www.vbinfozine.com/a_strictoff.shtml <-- Option Strict Off Considered Harmful

Dim dtGrid As DataGrid = DirectCast(source,DataGrid)
0
 
dkilbyAuthor Commented:
I tried Option Strict Off and that didn't work, added Imports System.Web.UI.WebControls and works now.

Thanks
0
All Courses

From novice to tech pro — start learning today.