title: ASP.NET GridView use FindControl() on BoundField to manipulate field
body: <p>I'm working with an old app that had hard coded columns for different locations, now that new locations are being added I decided to try and make things populate dynamically.  One of the features of the app was displaying red text and bolding text when a status was deemed &quot;bad&quot;.  This was executed by using the &quot;FindControl()&quot; function from the cells within the selected row with TemplateFields.</p>
  <p>Now that I've set this up to use a bound field, how would I go about changing the text color, size, etc. during the DataBound event?</p>
  <h3>BoundField Being Added To GridView</h3>
  <pre><code>        BoundField statusField = new BoundField();
          statusField.DataField = &quot;ExceptionStatusCode&quot;;
          statusField.HeaderText = &quot;Status&quot;;
          statusField.SortExpression = &quot;ExceptionStatusCode&quot;;
          this.gvView.Columns.Add(statusField);
          
  </code></pre>
  <h3>DataBound Event For GridView</h3>
  <pre><code>    protected void gvView_DataBound(object sender, EventArgs e)
      {
          foreach (GridViewRow row in this.gvView.Rows)
          {
              //NO LONGER WORKS, NEED TO KNOW HOW TO REPRODUCE
              //WHAT IS BELOW FOR BOUND FIELD
              Label lblPartStatus = ((Label) row.Cells[StatusColumn].FindControl(&quot;lblPartStatus&quot;));
              if (lblPartStatus.Text == &quot;BAD&quot;)
              {
                  lblPartStatus.ForeColor = System.Drawing.Color.Red;
                  row.ToolTip = &quot;One or more locations is missing information!&quot;;
                  row.BackColor = System.Drawing.Color.Salmon;
              }
          }
      }
  </code></pre>