Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to deal with dropdownlist problem
Message
De
02/11/2004 17:38:56
 
 
À
02/11/2004 08:40:45
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00955764
Message ID:
00957379
Vues:
12
Wilson,

Thank you very much for the explanation.

>> Dim _index As Integer
> 'ListBox has a collection of ListItems
> 'So declared a ListItem and assigned the Text and SelectedValue you are looking for
>> Dim _Item As New ListItem(DS_Products1.Tables(0).Rows(selIndex).Item("SupplierCode"))
>> _Item.Value = _Item.Text
>
>'IndexOf returns the position if the text just search
>> _index = Me.DropDownList1.Items.IndexOf(_Item)
>'If not found _index will contain -1, otherwise will contain the position where the text was found in the List
>
>'So here i am setting the selected item to the position i just found.
>> DropDownList1.SelectedIndex = _index
>
>'If -1 no item will be selected
"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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform