private void Inicializar() { try { List <Comun> List = new List <Comun>(); Comun c = new Comun(); c.Id = -1; c.Descripcion = "--Todos--"; List.Add(c); CmbCdi.DataSource = List; CmbCdi.DataValueField = "Id"; CmbCdi.DataTextField = "Descripcion"; CmbCdi.DataBind(); CmbRepresentante.DataSource = List; CmbRepresentante.DataValueField = "Id"; CmbRepresentante.DataTextField = "Descripcion"; CmbRepresentante.DataBind(); this.CmbCdi.Enabled = false; this.CmbRepresentante.Enabled = false; this.CmbTipo.SelectedValue = "-1"; this.rdFechaIni.SelectedDate = (DateTime?)null; this.rdFechaFin.SelectedDate = (DateTime?)null; this.TxtDF_Comentario.Text = string.Empty; } catch (Exception ex) { throw ex; } }
protected void CmbNivel_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { List <Comun> List = new List <Comun>(); Comun c = new Comun(); c.Id = -1; c.Descripcion = "--Todos--"; List.Add(c); if (this.CmbNivel.SelectedValue == "1") { CmbCdi.DataSource = List; CmbCdi.DataValueField = "Id"; CmbCdi.DataTextField = "Descripcion"; CmbCdi.DataBind(); CmbRepresentante.DataSource = List; CmbRepresentante.DataValueField = "Id"; CmbRepresentante.DataTextField = "Descripcion"; CmbRepresentante.DataBind(); this.CmbCdi.Enabled = false; this.CmbRepresentante.Enabled = false; } else if (this.CmbNivel.SelectedValue == "2" || this.CmbNivel.SelectedValue == "3") { CargarCDI(); this.CmbCdi.Enabled = true; CmbRepresentante.DataSource = List; CmbRepresentante.DataValueField = "Id"; CmbRepresentante.DataTextField = "Descripcion"; CmbRepresentante.DataBind(); this.CmbRepresentante.Enabled = false; } } catch (Exception ex) { ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name); } }