How to Add File Upload Control in TableCell using C#
<p>I am creating the grid view in code behind using TableCell and GridViewRow</p>

<p>The data is fetched from the database table.</p>

<p>My code is :  </p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class gv1 : System.Web.UI.Page
{
    SqlConnection cn;
    SqlCommand cmd;
    DataSet ds;
    SqlDataAdapter da;

   protected void Page_Load(object sender, EventArgs e)
  {
     cn = new SqlConnection("Data Source=AMIR-PC\\MOHEMMAD;Initial Catalog=CRM_InvestPlus;Integrated Security=True");

  }
  protected void Button1_Click(object sender, EventArgs e)
 {
    cn.Open();
    cmd = new SqlCommand("Select * from Customer_Master", cn);
    da = new SqlDataAdapter(cmd);
    ds = new DataSet();
    da.Fill(ds);
    cn.Close();

    GridView gr1 = new GridView();
    Table t = new Table();
    gr1.Controls.Add(t);

        for (int i = 0; i &lt; 6; i++)
       {
           GridViewRow row = new GridViewRow(i, i, DataControlRowType.DataRow, DataControlRowState.Normal);
           TableCell cell1 = new TableCell();
           TableCell cell2 = new TableCell();
           TableCell cell3 = new TableCell();

           cell1.Text = ds.Tables[0].Rows[i][0].ToString();
           cell2.Text = ds.Tables[0].Rows[i][1].ToString();
           cell3.Text = ds.Tables[0].Rows[i][2].ToString();
           row.Cells.Add(cell1);
           row.Cells.Add(cell2);
           row.Cells.Add(cell3);

            gr1.Controls[0].Controls.AddAt(i, row);    

        }
        form1.Controls.Add(gr1);
    }
}
</code></pre>

<p>The Gridview is generated fine. But my problem is to display the FileUploadControl in the place of Cell3(i.e. I want to place the FileUploadControl in Cell3)  </p>

<p>Please help..  </p>

<p>Thanks in advance...</p>
