title: Set backcolor of a Gridview control, when it is enabled or disabled
body: <p>In my gridview controls are enabled or disabled depending on user roles. I want to change the background color to yellow for enabled controls. I have tried to do it in <code>RowCreated</code> as below but all the cells are enabled at that time. </p>
  
  <pre><code>protected void begv_OrderDetail_RowCreated(object sender, GridViewRowEventArgs e)
  {
       foreach (TableCell cell in e.Row.Cells)
       {
            if (cell.Enabled == true)
            {
            }
            else
            {
               //Never enters this area
            }
  
       }
  }
  </code></pre>
  
  <p>Here is an example field in my gridview where I enable or disable the controls.</p>
  
  <pre><code>    &lt;asp:TemplateField HeaderText="ReasonCode" SortExpression="ReasonCode"&gt;
          &lt;HeaderTemplate&gt;
              &lt;asp:Label ToolTip="ReasonCode" runat="server" Text="RC"&gt;&lt;/asp:Label&gt;
          &lt;/HeaderTemplate&gt;
          &lt;EditItemTemplate&gt;
              &lt;asp:TextBox ID="txt_ReasonCode" onchange="disableNextStatusButtons()" runat="server" Text='&lt;%# Bind("ReasonCode") %&gt;'
                  Enabled='&lt;%# (Roles.IsUserInRole("İhracat Uzmanı") &amp;&amp; Session["Status"].ToString()=="3") %&gt;'
                  Width="40px"&gt;&lt;/asp:TextBox&gt;
          &lt;/EditItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
  </code></pre>