title: How do I use a DropDownList in a Gridview Edit Template when the selected value does not mirror sql data?
body: <p>I am using some dropdowns in a gridview and have been able to convert where the dropdown would say "Monday"(for a bit of user friendliness) to just a simple "1" on insert(so I can easily do sql date time querys). Now I need to be able to do the reverse for the edit template on the gridview. When I hit edit now I get the error "The selected value doesnt exist in the control". I understand that the reason for this is because the value is a <code>1</code> instead of <code>Monday</code>. Here is my failed attempt to solve the problem:</p>
  
  <pre><code>protected void EditFoodItem(object sender, GridViewEditEventArgs e)
  {
   string Day = ((DropDownList)gvMainView.FooterRow.FindControl("ddlDay")).SelectedValue;
          switch (Day)
          {
              case "1":
                  Day = "Monday";
                  break;
              case "2":
                  Day = "Tuesday";
                  break;
              case "3":
                  Day = "Wednesday";
                  break;
              case "4":
                  Day = "Thursday";
                  break;
              case "5":
                  Day = "Friday";
                  break;
              case "6":
                  Day = "Saturday";
                  break;
              case "7":
                  Day = "Sunday";
                  break;
          }
  }
  </code></pre>
  
  <p>If the value in the gridview is <code>1</code> How can I get the selected value to go to <code>Monday</code>...this seems rather simple but it is alluding me</p>
  
  <p>Here is the control</p>
  
  <pre><code>&lt;EditItemTemplate&gt;
              &lt;asp:DropDownList ID="ddlDay" SelectedValue='&lt;%# Bind("Day") %&gt;' Text='&lt;%# Bind("Day") %&gt;' runat="server"&gt;
                      &lt;asp:ListItem&gt;Monday&lt;/asp:ListItem&gt;
                      &lt;asp:ListItem&gt;Tuesday&lt;/asp:ListItem&gt;
                      &lt;asp:ListItem&gt;Wednesday&lt;/asp:ListItem&gt;
                      &lt;asp:ListItem&gt;Thursday&lt;/asp:ListItem&gt;
                      &lt;asp:ListItem&gt;Friday&lt;/asp:ListItem&gt;
                      &lt;asp:ListItem&gt;Saturday&lt;/asp:ListItem&gt;
                      &lt;asp:ListItem&gt;Sunday&lt;/asp:ListItem&gt;
              &lt;/asp:DropDownList&gt;
          &lt;/EditItemTemplate&gt; 
  </code></pre>