Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to deal with dropdownlist problem
Message
 
 
To
02/11/2004 08:40:45
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00955764
Message ID:
00957379
Views:
11
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform