Foros del Web » Programando para Internet » ASPX (.net) »

edicion de gridview en c#

Estas en el tema de edicion de gridview en c# en el foro de ASPX (.net) en Foros del Web. hola buenos dias tengo una duda que no he logrado solucionar agradecere mucho su ayuda por favor! tengo un grid view y en el code ...
  #1 (permalink)  
Antiguo 30/10/2008, 10:15
 
Fecha de Ingreso: octubre-2005
Mensajes: 2
Antigüedad: 18 años, 6 meses
Puntos: 0
edicion de gridview en c#

hola buenos dias tengo una duda que no he logrado solucionar agradecere mucho su ayuda por favor!

tengo un grid view y en el code behind al momento de disparar el evento RowUpdating me marca el error de "Object reference not set to an instance of an object" en la linea que esta en rojo

protected void GridView2_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
{
GridViewRow fila = GridView2.Rows[e.RowIndex];
if (!(fila == null))
{
Label lbl1 = new Label();
// lbl1.Text = CType(fila.FindControl("Label1"), Label).Text
// lbl1.Text = CType(fila.FindControl("TextBox1"), TextBox).Text
String categoryID = ((TextBox)(fila.FindControl("TextBox3"))).Text;
String name = ((TextBox)(fila.FindControl("TextBox1"))).Text;
String dep = ((TextBox)(fila.FindControl("TextBox2"))).Text;
String tipo = ((TextBox)(fila.FindControl("TextBox4"))).Text;
//DataList1.DataKeys[e.Item.ItemIndex].ToString();
//String categoryName =
// ((TextBox)e.Item.FindControl("textCategoryName")). Text;
String description = ((TextBox)(fila.FindControl("TextBox5"))).Text;

SqlDataSource2.UpdateParameters["ID"].DefaultValue = categoryID; SqlDataSource2.UpdateParameters["NOMBRE"].DefaultValue = name;
SqlDataSource2.UpdateParameters["DEPTO"].DefaultValue = dep;
SqlDataSource2.UpdateParameters["TIPO"].DefaultValue = tipo;
SqlDataSource2.UpdateParameters["DESCRIPCION"].DefaultValue = description;
SqlDataSource2.Update();
GridView2.EditIndex = -1;
EnlazarDatos();
}
}

cualquier ayuda seria muy agradecida muchas gracias
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:55.