hii,
how to create dynamically created textbox event ??
here is my code :
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
DataTable dt = new DataTable();
dt = obj.GetDataTable("ConnectionString", "SELECT vchName FROM Employee");
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
TableCell HeaderCell = new TableCell();
HeaderCell.Text = dt.Rows[i].ItemArray[0].ToString();
HeaderCell.Width = 80;
e.Row.Cells.AddAt(0, HeaderCell);
}
}
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataTable dt = new DataTable();
dt = obj.GetDataTable("ConnectionString", "SELECT vchName FROM Employee");
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
TextBox txt = new TextBox();
txt.ID = "txtID"+i;
txt.Visible = true;
txt.Text = "";
txt.Width = 50;
txt.MaxLength = 2;
//txt.TextChanged += new EventHandler(this.txt_TextChanged);
TableCell RowCell = new TableCell();
RowCell.Controls.Add(txt);
e.Row.Cells.AddAt(0, RowCell);
}
}
}
}
Please help me .it's urgent.
Thanks & Regards
Manoj Kumar