Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting a default item in a DropDownList
Message
 
To
29/10/2002 10:30:32
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00716444
Message ID:
00716496
Views:
14
This message has been marked as the solution to the initial question of the thread.
You use the SelectedIndex property of the ComboBox to set the index. The indexes are zero based so to get item 2 you use index of 1.
ComboBox1.SelectedIndex = 1;
>I created a ComboBox DropDownList with 4 items in it. I want the second item to be highlighted in the list when the WinForm displays. How do I set this?
>
>In VFP I would use ListItemID = 2. How do you do this in C#?
>
>Thanks,
>
>Jerry
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform