How to change selected item on combobox in code behind


/ Published in: Visual Basic
Save to your folder(s)

Example to change the selected item in a ComboBox, in code behind. For VB.Net


Copy this code and paste it in your HTML
  1. Dim value as string = "1"
  2.  
  3. comboname.FindItemByValue(value).Selected = True
  4.  
  5. 'This select the first element of the combo if the DefaultValue is numeric, in other case, change the value var 'value'.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.