While viewing the page, you must be having the information if the current user is an admin or user. Based on this information, you will set the visibility of the control.
Use grid's
RowDataBound
method to set the visiblity.
Protected Sub GridView_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
Dim rtype As DataControlRowType = e.Row.RowType
If ((rtype = DataControlRowType.DataRow) _
AndAlso ((rtype <> DataControlRowType.Footer) _
AndAlso ((rtype <> DataControlRowType.Separator) _
AndAlso ((rtype <> DataControlRowType.Header) _
AndAlso (rtype <> DataControlRowType.Pager))))) Then
If (currentRole <> "Admin") Then
Dim btn As Button = CType(e.Row.FindControl("DeleteButton1"),Button)
btn.Enabled = false
End If
End If
End Sub
Try!