title: Conditionally hide DeleteButton in GridViewCommandColumn
body: <p>I have ASPxGridView to view a list of records. From the view, I create a delete column and want it to show a delete button whenever the record does have a satisfy condition. The code below:</p>
  
  <pre><code>&lt;dx:GridViewCommandColumn Caption="Delete" VisibleIndex="1" Width="30px"
                  meta:resourcekey="GridViewCommandColumnResource1"&gt;
                  &lt;DeleteButton Visible="True"&gt;
                  &lt;/DeleteButton&gt;
              &lt;/dx:GridViewCommandColumn&gt;
  </code></pre>
  
  <p>So I focus on the Visible attribute of DeleteButton. The condition must return a boolean value so it knows when to show and hide the delete button. Below is an example how to implement this:</p>
  
  <pre><code>&lt;DeleteButton Visible='&lt;%# ShowHide(Eval("Active")) %&gt;'&gt;
                  &lt;/DeleteButton&gt;
  </code></pre>
  
  <p>in VB Code:</p>
  
  <pre><code>Protected Function ShowHide(Active As Boolean) As Boolean
      Return Active
  End Function
  </code></pre>
  
  <p>So the function need to return a True value if <strong>Active</strong> is True, and False value if <strong>Active</strong> is False. In other words, I do trigger a function in code behind on every record to make it show the delete button if record does have a satisfy condition. But I got an error message in the end:</p>
  
  <pre><code>Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. DevExpress.Web.ASPxGridView.GridViewCommandColumnButton does not have a DataBinding event.
  </code></pre>
  
  <p>I stuck there and don't know other way to do this. Please help me with this.</p>