protected void slItems_OnSelectedIndexChanged(object sender, EventArgs e) { var pdno = txtWorkOrder.Text.Trim().ToUpper(); var item = slItems.SelectedValue.Trim().ToUpper(); if (slItems.SelectedValue.Trim() != String.Empty) { slLot.Items.Clear(); var lotes = _idaltticol125.consultaPorOrnoItem(ref pdno, ref item, ref strError); ListItem itemSeleccione = new ListItem() { Text = _idioma == "INGLES" ? "--Select an option--" : "--Seleccione una opción--", Value = "" }; slLot.Items.Insert(0, itemSeleccione); if (lotes.Rows.Count > 0) { foreach (DataRow itemLista in lotes.Rows) { if (itemLista["CLOT"] != null) { ListItem itemLote = new ListItem() { Value = itemLista["CLOT"].ToString(), Text = itemLista["CLOT"].ToString() }; slLot.Items.Insert(slLot.Items.Count, itemLote); } } } var registro = _consultaInformacionPedido.AsEnumerable().Where(x => x["SITM"].ToString().Trim() == item).FirstOrDefault(); txtDescription.Text = registro["DSCA"].ToString().Trim(); txtUnit.Text = registro["CUNI"].ToString().Trim(); hdfQuantity.Value = registro["CANTIDAD"].ToString().Trim(); } else { txtDescription.Text = String.Empty; txtUnit.Text = String.Empty; txtQty.Text = String.Empty; txtShift.Text = String.Empty; slLot.Items.Clear(); } }