title: Changing Control Type in GridView conditionally
body: <p>I am using Gridview Template Fields, I want to check </p>
  
  <p>if Session is Set then Retrieve the RegionID from Session and store it in a hidden field, 
  else 
  Show a drop down box consisting of all the regions. 
  Sample Code.</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="Region"&gt;
  &lt;ItemTemplate&gt;
  &lt;% if(Session["REGION"]!=null) %&gt;
  &lt;asp:TextBox ID="txtRegion" value=&lt;%Session["REGION"]% /&gt;
  &lt;% else %&gt;
  &lt;asp:DropDownList ID="txtRegion" /&gt;
  &lt;/ItemTemplate&gt;
  </code></pre>
  
  <p>How should i achieve this.</p>
  
  <p>Any Ideas. </p>