title: Retrieve DropDownList value in RowUpdating event asp.net
body: <p>Here is my aspx code:</p>
  
  <pre><code>&lt;EditItemTemplate&gt;
     &lt;asp:DropDownList ID="ddlTotalColumn" runat="server"&gt;
         &lt;asp:ListItem Value=""&gt;Select value&lt;/asp:ListItem&gt;
         &lt;asp:ListItem Value="0"&gt;1&lt;/asp:ListItem&gt;
         &lt;asp:ListItem Value="1"&gt;2&lt;/asp:ListItem&gt;
     &lt;/asp:DropDownList&gt;
  &lt;/EditItemTemplate&gt;
  </code></pre>
  
  <p>My aspx.cs code:</p>
  
  <pre><code>protected void gvTest_RowUpdating(object sender, GridViewUpdateEventArgs e)
  {
      GridViewRow selected_row = gvTest.Rows[e.RowIndex];
  
      var total_column_drop_down_list = (DropDownList)selected_row.FindControl("ddlTotalColumn");
  
      int column_string = Convert.ToInt32(total_column_drop_down_list.SelectedItem.Value);
  
      gvTest.EditIndex = -1;
      ...
  }
  </code></pre>
  
  <p>At this line: int column_string = Convert.ToInt32(total_column_drop_down_list.SelectedItem.Value);
  I have an error: "Input string was in incorrect format" because "total_column_drop_down_list.SelectedItem.Value" will return empty string ("").</p>
  
  <p>So is there any bright idea?</p>