asp.net + datagriditem is not defined

Posted on 2005-03-20
Medium Priority
Last Modified: 2012-08-13
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)


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

Question by:dkilby
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 23

Expert Comment

ID: 13588602
Because option strict is set to on

URL for your consideration:
http://www.vbinfozine.com/a_strictoff.shtml <-- Option Strict Off Considered Harmful

Dim dtGrid As DataGrid = DirectCast(source,DataGrid)
LVL 12

Accepted Solution

laotzi2000 earned 1000 total points
ID: 13588630
You should imports name space System.Web.UI.WebControls
Imports System.Web.UI.WebControls

Both datagrid and datagriditem are in this namespace

Author Comment

ID: 13592092
I tried Option Strict Off and that didn't work, added Imports System.Web.UI.WebControls and works now.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month9 days, 6 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question