title: Change databound Drop Down List programmatically
body: <p>I have a drop down list that is populated in the page load event from a database table.   </p>
  
  <p>The drop down has a DataTextField set to a project name and the DataValueField set to the project id (interger). </p>
  
  <p>Later I change the dropdowlist selected item with this code in the selectedindexchanged event of a gridview</p>
  
  <pre><code>GridViewRow row = GridView1.SelectedRow;
  ddlProjectList.SelectedItem.Text = row.Cells[2].Text;
  </code></pre>
  
  <p>Does Changing the drop down list with this code cause the DataValueField property to change to the correct Project ID number also? If not is there a better way to do this?</p>
  
  <p>=============================================EDIT
  actually this code seems to be adding an additional item to the list so that the project i set with this code is listed twice so I don't think my code is correct</p>