title: Conditional Eval in Gridview Template row
body: <p>I am having an issue that I am certain is easy to resolve, I just don't know what to do.
  Here is my code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;asp:TemplateField&gt;
      &lt;HeaderTemplate&gt;
          &lt;asp:Literal ID="text_shipped" Text="Media Shipped" runat="server" /&gt;
          &lt;br /&gt;
      &lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:Label ID="lbl_shipped" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "shipped") %&gt;' /&gt;--&gt;&lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  &lt;asp:TemplateField&gt;
      &lt;HeaderTemplate&gt;&lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:Button ID="lnk_ship" runat="server" CssClass="btn-mini" Text="Ship Software" Visible='&lt;%# DataBinder.Eval(Container.DataItem, "shipped" ) == "Yes" ? true : false %&gt;' /&gt;--&gt;&lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>The label "lbl_shipped" is showing the correct value which is either "Yes" or "No" 
  but, i want to add a button "lnk_ship", based on whether
   or not the value is "Yes" (show button), or "No" (do not show button).</p>
  
  <p>My issue is that I am using conditional code on the Visible keyword and I am testing for the value, but it seem to be ignoring my value for "shipped"</p>
  
  <p>here are the main two lines, the first one shows the value, the second line is conditional, the conditional is NOT working. it keeps showing false:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;asp:Label ID="lbl_shipped" runat="server" Text='&lt;%# DataBinder.Eval(Container.DataItem, "shipped") %&gt;' /&gt;
  &lt;asp:Button ID="lnk_ship" runat="server" CssClass="btn-mini" Text="Ship Software" Visible='&lt;%# DataBinder.Eval(Container.DataItem, "shipped" ) == "Yes" ? true : false %&gt;' /&gt;
  </code></pre>