I am trying to programatically select an item from a listbox on a .net webform. After populating the list in the page load, I want to tell the listbox to select a value from its list as if the user had done so. Can this be done.
Printable View
I am trying to programatically select an item from a listbox on a .net webform. After populating the list in the page load, I want to tell the listbox to select a value from its list as if the user had done so. Can this be done.
set the selectedIndex property of the listbox control to the index desired. This will highlight the item as if the user clicked on it.