title: how to disable all rows in gridview in asp.net
body: <p>I am trying to disable all rows like text-box and drop-down controls in the gridview based on some condition that i set for the gridview.  I have it now where it changes the color but i also want to lock it or disable those controls how can i do that?</p>
  
  <pre><code>protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
      {
          if (e.Row.RowType == DataControlRowType.DataRow)
          {
              Label lblEndDate = (Label)e.Row.FindControl("lblStudyEndDate");
              DateTime EndDate = DateTime.Parse(lblEndDate.Text);
              if (EndDate &lt; DateTime.Today)
              {
                 //make all rows to read only here.. 
  
              }
          }
      }
  </code></pre>