title: How to disable "Edit" button in Gridview?
body: <p>Iam using Item Template field in my gridview to update the values inside particular column.
  The ItemTemplate field contains "label" control and EditItemTemplate contains "DropDownList". Now the problem is I need to disable the "Edit" button based on the value of "Label"... Attached the lines of coding. Can anyone give me a solution.</p>
  
  <pre><code>Home.Aspx:
  **********
     &lt;Columns&gt;
  
                      &lt;asp:BoundField DataField="Date" HeaderText="Date" ReadOnly="true" /&gt;
                      &lt;asp:BoundField DataField="Type" HeaderText="Type" ReadOnly="true" /&gt;
                      &lt;asp:BoundField DataField="Reason" HeaderText="Reason" ReadOnly="true" /&gt;
                      &lt;asp:BoundField DataField="Request By" HeaderText="Request By" ReadOnly="true" /&gt;
                      &lt;asp:TemplateField HeaderText="Status" HeaderStyle-HorizontalAlign="center"&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:DropDownList ID="ddlState" AutoPostBack="false" runat="server"&gt;
                                  &lt;asp:ListItem Text="Approved" Value="Approved"&gt;  &lt;/asp:ListItem&gt;
                                  &lt;asp:ListItem Text="Declined" Value="Declined"&gt;  &lt;/asp:ListItem&gt;
                                  &lt;asp:ListItem Text="Pending" Value="Pending"&gt;  &lt;/asp:ListItem&gt;
                              &lt;/asp:DropDownList&gt;
                          &lt;/EditItemTemplate&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblName" runat="server" Text='&lt;%# Bind("Status") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;HeaderStyle HorizontalAlign="Center"&gt;&lt;/HeaderStyle&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:CommandField ShowEditButton="True" /&gt;
                  &lt;/Columns&gt;
  </code></pre>
  
  <p><strong>Here in my coding "lblName" has the status value in ItemTemplate and "ddlState" has the status value in EditItemTemplate. Based upon the "lblName" value , "Edit" option has to be enabled</strong>...</p>