Skip to content

Instantly share code, notes, and snippets.

@mattcan
Created January 17, 2012 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattcan/1629120 to your computer and use it in GitHub Desktop.
Save mattcan/1629120 to your computer and use it in GitHub Desktop.
DevExpress ASPxGridView CommandColumn Visibility
Private Sub theGrid_DataBound(ByVal sender as Object, ByVal e as System.EventArgs) Handles theGrid.DataBound
' Create a GridView object and cast the GridView object we're working on to it
Dim gv As ASPxGridView = TryCast(sender, ASPxGridView)
' Loop through the visible columns (as they are set in the ASP or somewhere else in your code)
For i As Integer = 0 To gv.VisibleColumns.Count
' Match the type of the current column to the GridViewCommandColumn type and
' then hide the column and break out of the loop
If TypeOf (gv.VisibleColumns(i)) Is GridViewCommandColumn Then
gv.VisibleColumns(i).Visible = False
Exit For
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment