title: How to test if a row of gridview is empty asp.net
body: <p>I have a empty grid view at the page load .
  In the RowDataBound event I add a dropdownlist to the last cell
  The problem is that the ddl is shown at the page load.
  I want to hide it if the cells of row are empty</p>
  
  <pre><code>protected void grw_RowDataBound(object sender, GridViewRowEventArgs e)
      {
          if (e.Row.RowType == DataControlRowType.DataRow)
          {
              DropDownList ddl = e.Row.FindControl("ddlAccepted") as DropDownList;
              if (null != ddl)
              {
                  string acceptedKey = (e.Row.FindControl("lblAccepted") as Label).Text;
                  string acceptedValue = "";
                  if (acceptedKey == "True")
                  {
                      acceptedValue = "Oui";
                  }
                  else if (acceptedKey == "False")
                  {
                      acceptedValue = "Non";
                  }
  
                  ddl.Items.Add(new ListItem("Non", "False"));
                  ddl.Items.Add(new ListItem("Oui", "True"));
  
                  ddl.SelectedValue = acceptedValue;
              }
  
  
          }
  
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/s1O9R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s1O9R.png" alt="enter image description here"></a>
  Thank you.</p>