void AddListaSubRubro() { SubRubroBLL subrubroBLL = new SubRubroBLL(); tablaSubRubros.DataSource = subrubroBLL.listarSubRubros(); tablaSubRubros.DataBind(); }
protected void tablaSubRubros_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { SubRubroBLL subrubroBLL = new SubRubroBLL(); tablaSubRubros.EditIndex = -1; tablaSubRubros.DataSource = subrubroBLL.listarSubRubros(); tablaSubRubros.DataBind(); }
protected void tablaSubRubros_RowEditing(object sender, GridViewEditEventArgs e) { SubRubroBLL subrubroBLL = new SubRubroBLL(); tablaSubRubros.EditIndex = Convert.ToInt16(e.NewEditIndex); //HiddenField1.Value = e.NewEditIndex.ToString(); tablaSubRubros.DataSource = subrubroBLL.listarSubRubros(); tablaSubRubros.DataBind(); }
protected void tablaSubRubros_RowUpdating(object sender, GridViewUpdateEventArgs e) { SubRubroBLL subrubroBLL = new SubRubroBLL(); SubRubro subrubro = new SubRubro(); //TextBox text = tablaSubRubros.Rows[e.RowIndex].Cells[1].Controls[0] as TextBox; //int id = Convert.ToInt32(tablaSubRubros.DataKeys[e.RowIndex].Values[0]); //string desc = text.Text; subrubroBLL.editarSubRubro(subrubro); tablaSubRubros.EditIndex = -1; tablaSubRubros.DataSource = subrubroBLL.listarSubRubros(); tablaSubRubros.DataBind(); }