title: Visibility of an ASP.Net button which depends if a file exists in database
body: <p>I have a gridview which has a few rows (each with a unique <code>rowId</code>), and each line has a <code>FileUpload</code> control, now everything works okay with <code>FileUpload</code>. </p>
  
  <p>(my uploaded file database image can be seen below)</p>
  
  <p>I have the download button, which also works okay, however I want to make this button invisible if no file exists for the corresponding row. </p>
  
  <p>Nothing proper comes to my mind. </p>
  
  <p>My button and <code>FileUpload</code> control:</p>
  
  <pre><code>    &lt;asp:TemplateField HeaderText="BatchList"&gt;
          &lt;EditItemTemplate&gt;
              &lt;asp:ImageButton ID="ibt_Download" runat="server" src="Images/Download.png" CommandName="Download" CommandArgument='&lt;%# Container.DataItemIndex %&gt;' &gt;&lt;/asp:ImageButton&gt;
          &lt;/EditItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;asp:TemplateField HeaderText="UploadBatchList"&gt;
          &lt;HeaderTemplate&gt;
              &lt;asp:Label ID="lbl_Header" ToolTip="Upload Batch List" runat="server" Text="UBL"&gt;&lt;/asp:Label&gt;
          &lt;/HeaderTemplate&gt;
          &lt;EditItemTemplate&gt;
              &lt;asp:FileUpload ID="fu_UploadBatchList" runat="server" /&gt;
              &lt;asp:Button ID="btn_Upload" runat="server" Text="Upload" OnClick="btn_Upload_Click" /&gt;
          &lt;/EditItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>This is how it looks on my gridView</p>
  
  <p><img src="https://i.stack.imgur.com/7rXRq.jpg" alt="enter image description here"></p>
  
  <p>When gridview is first created the green dots must not be visible if a file has been uploaded before.</p>
  
  <p>My file database: </p>
  
  <p><img src="https://i.stack.imgur.com/FCp2g.jpg" alt="enter image description here"></p>