title: getting null value in dropdownlist on rowdatabound event using gridview
body: <p>I am getting error :-<code>"Object reference not set to an instance of an object."</code></p>
  
  <p>When I want to bind the data into <code>dropdownlist</code> this will give me error.
  Here is my code:</p>
  
  <pre><code>protected void EventRequirementGridView_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
           DropDownList ddllist = (DropDownList)e.Row.FindControl("modeldropdownlist");
  
           ddllist.SelectedValue = DataBinder.Eval(e.Row.DataItem, "exammode").ToString();               
      }
  }
  </code></pre>