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

Click here to load this message in the networking platform