Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to deal with dropdownlist problem
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Titre:
How to deal with dropdownlist problem
Divers
Thread ID:
00955764
Message ID:
00955764
Vues:
52
I was wondering if someone knows how to get around the following problem.

I have a dropdownlist (ddl) on a web form. The dropdownlist is bound to a dataset (dataview) of two columns (but I think the problem would be the same with one column too). Property .DataValueField of the ddl is set to one of the column names, MYFLD. When web form is initialized, a default value is set to the property .SelectedValue.

The problem is that if the default value set in the .Selectedvalue property is not in the dataset, web form bombs with error:
Specified argument was out of the range of valid values.
Is there a way to make dropdownlist still accept the value even if it is not in the dataset to which dropdownlist is bound?

Thank you in advance for any suggestions.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform