title: How to disable a control in command field control in gridview
body: <p>how to find a command field control in the gridview.</p>
  
  <p>in a method not in the row data bound.</p>
  
  <p>so far i have used this coding but i cant find the control.</p>
  
  <pre><code>&lt;asp:CommandField ButtonType="Image" ShowEditButton="True
                    HeaderText="Enter Leave"
                    EditImageUrl="~/IMAGES/edit-icon.gif"&gt;
      &lt;ItemStyle HorizontalAlign="Center" /&gt;
  &lt;/asp:CommandField&gt;
  </code></pre>
  
  <p>source code:</p>
  
  <pre><code>ImageButton edit = (ImageButton)EmployeeDetails.FindControl("Image");
  edit.Enabled = false;
  </code></pre>