private void combotipogasto() { if (this.dl_cliente.SelectedValue == "0") { return; } if (this.dl_producto.SelectedValue == "0") { return; } GastosComunes mGastosComunes = new GastosComunes(); mGastosComunes.Id_tipogasto = 0; mGastosComunes.Descripcion = "Seleccionar"; List <GastosComunes> lGastosComunes = new GastosComunesBC().getallGastosComunes(Convert.ToInt32(this.dl_familia.SelectedValue)); lGastosComunes.Add(mGastosComunes); }
protected void gr_dato_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { EstadoTipoOperacion mestado = new EstadoTipoOperacion(); mestado.Codigo_estado = 0; mestado.Descripcion = "Seleccionar"; List <EstadoTipoOperacion> lestado = new EstadotipooperacionBC().getEstadoByFamilia(id_fam); lestado.Add(mestado); DropDownList dl2 = (DropDownList)e.Row.FindControl("dl_estado"); dl2.DataSource = lestado; dl2.DataValueField = "codigo_estado"; dl2.DataTextField = "descripcion"; dl2.DataBind(); //dl2.SelectedValue = "0"; GastosComunes gastos = new GastosComunes(); gastos.Id_tipogasto = 0; gastos.Descripcion = "seleccionar"; List <GastosComunes> lgastos = new GastosComunesBC().getallGastosComunes(id_fam); lgastos.Add(gastos); DropDownList dl = (DropDownList)e.Row.FindControl("dl_gasto"); dl.DataSource = lgastos; dl.DataValueField = "id_tipogasto"; dl.DataTextField = "descripcion"; dl.DataBind(); //dl.SelectedValue = "0"; FuncionGlobal.comboEstadoByFamilia(estado_dl, id_fam); FuncionGlobal.Combogasto(gasto_dl, id_fam); dl.SelectedValue = gr_dato.DataKeys[e.Row.RowIndex].Values[1].ToString(); dl2.SelectedValue = gr_dato.DataKeys[e.Row.RowIndex].Values[0].ToString(); } }