I need to copy the text from a gridview texbox to the others in the column.
Posted
by Gilberto Munoz
on Stack Overflow
See other posts from Stack Overflow
or by Gilberto Munoz
Published on 2009-07-21T15:17:24Z
Indexed on
2010/06/14
5:02 UTC
Read the original article
Hit count: 239
This is my code in c#
protected void ibtCopiar_Click(object sender, ImageClickEventArgs e) {
GridViewRow grdrows = DGPlanilla.Rows[0];
TextBox tb1 = (TextBox)grdrows.FindControl("TextBox1");
string valor = tb1.Text;
if (valor != null || valor != "0")
{
foreach (GridViewRow grdrow in DGPlanilla.Rows)
{
grdrow.Cells[5].Text = valor;
}
}
}
this my code for the button
when i debug i see that the value i have in the firts box is pass to the other textboxes in the column, but when it dysplay the page onle the first box show the value i have enter. the other texboxes don´t change.
© Stack Overflow or respective owner