title: If condition into Gridview Column design
body: <p>I have a gridview. its data source is a datatable that is loaded from the database. In this gridview, i have a template column.</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="Product Type" SortExpression="ProductID"&gt;
                                          &lt;ItemStyle CssClass="MP-table-tb-display-item" /&gt;
                                          &lt;ItemTemplate&gt;
                                              &lt;div class="MP-table-tb-display-main"&gt;
                                                  &lt;asp:LinkButton ID="lnkview" CommandArgument='&lt;%# Eval("ProductID") %&gt;' CommandName="Viewproduct"
                                                      runat="server" CausesValidation="False" OnClick="lnkview_Click"&gt;&lt;h4&gt;
                                          &lt;%# Eval("Name") %&gt;
                                      &lt;/h4&gt;
                                                  &lt;/asp:LinkButton&gt;
                                              &lt;/div&gt;
                                              &lt;br /&gt;
                                              &lt;div class="MP-table-tb-display"&gt;
                                                  &lt;p&gt;
                                                      &lt;span&gt;KEY&lt;/span&gt;&lt;%# Eval("[product_type_key]") %&gt;&lt;/p&gt;
                                                  &lt;br /&gt;
  
                                                  &lt;a target="_blank" href='&lt;%# Eval("SourceURL") %&gt;'&gt;Source&lt;/a&gt;
                                              &lt;/div&gt;
                                          &lt;/ItemTemplate&gt;
                                      &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>In this I want Source hyperlink only show when data available into <code>&lt;%# Eval("SourceURL") %&gt;</code>. If I am not able to get the SourceURL value into <code>RowDatabound Event</code> . Please Guide me.</p>
  
  <p>I plan for this too but this is not working properly.</p>
  
  <pre><code>&lt;a target="_blank" href=' &lt;%= Eval("SourceURL")!=null ? Eval("SourceURL") : "style='display: none'" %&gt; /&gt;'&gt;  Source&lt;/a&gt;
  </code></pre>