I had a question while developing this code, I made a drop-down list in which each one has the value of an ID.
Now I want to develop a condition to disable more drop-down lists and enable them until you select an item where its value ID > 0
.
My problem is that I do not know what property I need to call this item to check its value when they select it, while I was investigating I got involved.
//un poco de idea de como esta desarrollado mi Dropdownlist
private void Lista1()
{
//codigo resumido como el de matrix
string selectSQL = "SELECT ID, Nombre FROM Muestra";
ListItem newItem = new ListItem();
newItem.Text = reader["Nombre"] + "";
newItem.Value = reader["ID"].ToString();
listauno.Items.Add(newItem);
}
//ejemplo de la condicion a formar
private void Habilitar()
{
if (condicion si item seleccionado es mayor al id 0 de la tabla Muestra))
{
//habilitar listas
listados.Enabled = true;
llstatres.Enabled = true;
}
else
{
//desabilitar
listados.Enabled = false;
listatres.Enabled = false;
}
}