The code works, but I think I've attached it to the wrong event.
My entire page code looks like this:
>>>
Imports System.Web.DynamicData
Imports DevExpress.Web.ASPxGridView
Partial Class List
Inherits System.Web.UI.Page
Protected blnAddYN As Boolean
Protected blnChgYN As Boolean
Protected blnZoomYN As Boolean
Protected blnDelYN As Boolean
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
blnAddYN = False
blnChgYN = False
blnDelYN = False
blnZoomYN = False
End Sub
Protected Sub ASPxGridView1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles ASPxGridView1.Load
For i As Integer = 0 To Me.ASPxGridView1.Columns.Count - 1
If TypeOf Me.ASPxGridView1.Columns(i) Is GridViewCommandColumn Then
CType(Me.ASPxGridView1.Columns(i), GridViewCommandColumn).NewButton.Visible = blnAddYN
CType(Me.ASPxGridView1.Columns(i), GridViewCommandColumn).UpdateButton.Visible = blnChgYN
CType(Me.ASPxGridView1.Columns(i), GridViewCommandColumn).DeleteButton.Visible = blnDelYN
CType(Me.ASPxGridView1.Columns(i), GridViewCommandColumn).EditButton.Visible = blnZoomYN
Exit For
End If
Next i
End Sub
End Class
<<<
If I set blnZoomYN to True, then the "Edit" button appears correctly, but when I click to edit a record, the "Update" button appears. Should I attach this code to a different event as well?