I need to copy the text from a gridview texbox to the others in the column.
- by Gilberto Munoz
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.