-1
I do a search of my comic book and I bring in, say, 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’m not getting it to work. Look 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;
}
}
In the above way, it doesn’t work and not even with the commented code, either. Someone knows how to make it work?
Webform and C usage#.
Is this dropdown populated with bank numbers? Do you want the displayed value to be "Bradesco S/A" and the value to be 237? That’s it?
– Laerte
@pnet can put the code of how your combo is being loaded?
– Arthur Menezes
The combo is already loaded. All the banks that operate in Brazil are already in the combo and their respective numbers (value). When I type the Cpf or cnpj of a client, then the search goes in my system and picks up the bank, account and etc. of that client. Just need the combo to display this bank name passing a value to it. Everything is already registered, all the same. I just don’t know how to show in the combo automatically when value is passed.
– pnet