title: C# - Populating Gridview
body: <p>I want to create a grid view with one column containing empty textboxes where the user can input a number (quantity), some regular columns and a column dedicated to images.</p>
  
  <p>I have the following code in C#:</p>
  
  <pre><code>    Label_Error.Visible = false;
  
      DataTable dt = new DataTable();
      dt.Columns.Add("Quantity", typeof(TextBox));
      dt.Columns.Add("Book ID", typeof(int));
      dt.Columns.Add("Name", typeof(string));
      dt.Columns.Add("Author", typeof(string));
      dt.Columns.Add("Description", typeof(string));
      dt.Columns.Add("Price", typeof(float));
      dt.Columns.Add("Currency", typeof(string));
      dt.Columns.Add("Image", typeof(string));
  
      DataRow row1 = dt.NewRow();
      row1["Quantity"] = new TextBox();
      row1["Book ID"] = 1;
      row1["Name"] = "Moby Dick";
      row1["Author"] = "Herman Melville";
      row1["Description"] = "Adventure Book";
      row1["Price"] = 10;
      row1["Currency"] = "EUR";
      row1["Image"] = ResolveUrl("~/Images/Logo.png");
      dt.Rows.Add(row1);
  
      GridView_Products.DataSource = dt;
      GridView_Products.DataBind();
  </code></pre>
  
  <p>This is what I am getting at the output:</p>
  
  <p><img src="https://i.stack.imgur.com/zfJcM.png" alt="enter image description here"></p>
  
  <p>As you can see, the quantity column of empty textboxes is not being shown and the image is not being shown neither.  How can I solve these two problems please?</p>
  
  <p><strong>Update</strong></p>
  
  <p>This is the code in the .aspx page:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView_Products" runat="server" BackColor="White" 
              BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
              HorizontalAlign="Center"&gt;
              &lt;FooterStyle BackColor="White" ForeColor="#000066" /&gt;
              &lt;HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" 
                  HorizontalAlign="Center" /&gt;
              &lt;PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /&gt;
              &lt;RowStyle ForeColor="#000066" HorizontalAlign="Center" /&gt;
              &lt;SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /&gt;
              &lt;SortedAscendingCellStyle BackColor="#F1F1F1" /&gt;
              &lt;SortedAscendingHeaderStyle BackColor="#007DBB" /&gt;
              &lt;SortedDescendingCellStyle BackColor="#CAC9C9" /&gt;
              &lt;SortedDescendingHeaderStyle BackColor="#00547E" /&gt;
          &lt;/asp:GridView&gt;
  </code></pre>