title: DropDownList in GridView
body: <p>This question is actually two questions. I need to produce a gridview, with one column being a drop down selection.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ProjectsODS" OnRowUpdated="GridView1_RowUpdated" DataKeyNames="Id"
      CssClass="mGrid"
      PagerStyle-CssClass="pgr"
      AlternatingRowStyle-CssClass="alt" ShowHeaderWhenEmpty="True" OnRowEditing="GridView1_RowEditing"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField DataField="Name" HeaderText="Project Name" /&gt;
          &lt;asp:BoundField DataField="ProjectCode" HeaderText="Code" /&gt;
          &lt;asp:TemplateField HeaderText="Access"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:DropDownList runat="server" AutoPostBack="True"&gt;
                      &lt;asp:ListItem
                          Enabled="True"
                          Text="No Access"
                          Value="Test" /&gt;
                      &lt;asp:ListItem
                          Enabled="True"
                          Text="Read Only"
                          Value="Tes 2" /&gt;
                  &lt;/asp:DropDownList&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
  
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>The last column is indeed a drop down. But, at the moment, I am hard coding items in it, to see how it will render. I need to actually bind values from another ObjectDataSource. But for each row in the grid, it's the same data. Will it hit the ODS for each row, or is the data read into the ODS once, and used by each row?</p>
  
  <p>How do I link the ODS to the DropDownLists?</p>
  
  <p>Then, how do I get the selected value set to be a value from the row? That is, the data source that produces the gridview has a field called "AccessTypeId". I need that value to be used to select the value of the DDL. How would I do that?</p>
  
  <p>And then, I have set AutoPostBack to true. Once the DDL gets a new value set by the user, I want it to post the value. But, what even on the Grid is called when the DDL selected value is changed?</p>