ASP.net hide last column of bvound GridView (VB.net)

Hi

In ASP.net I bind data to my GridView using the code below. How do I hide the last column
(there are three columns)
If Not IsPostBack Then

            ' Declare the query string.

            Dim queryString2 As String = _
  "Select * From Questions"

            ' Run the query and bind the resulting DataSet
            ' to the GridView control.
            Dim ds2 As DataSet = GetData(queryString2)
            If (ds2.Tables.Count > 0) Then

                Me.GridView2.DataSource = ds2
                Me.GridView2.DataBind()

            Else

                'Me.Label_Error1.Text = "Unable to connect to the database. " & Err.Description

            End If

Open in new window

Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
jppintoCommented:
Or like this:

GridView1.Columns.Item(2).Visible = False
0
 
jppintoCommented:
did you tryed like this?

GridView2.Columns(2).Visible = False

0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.