I do a search on my DB and bring, say, the number 237. This is the value of my Combo that is equivalent to the text Bradesco S / A. So I would like the Dopdownlist to display this text Bradesco S / A when I pass the value (237). I can not make it work. Here's what I've done.
for (int i = 0; i < cmbBancos.Items.Count - 1; i++)
{
if (cmbBancos.Items[i].Value == nm_banco)
{
cmbBancos_SelectedIndexChanged(this, EventArgs.Empty);
//cmbBancos.Text = cmbBancos.Items[i].Text.ToString();
break;
}
}
As above, it does not work and neither does the commented code, either. Does anyone know how to make this work?
Use WebForm and C #.