Why can't I set the listbox selectedIndex to -1?



I have a simple webform that has a listbox that I bind to a dataview
at designtime. This provides an optional selection for the user so I
wanted to have no default value selected. So on the Page_Load event,
I set the selectedIndex to -1. However, when I run the page, the
default value is still 0, which forces the first item to be
automatically selected. I tried a bunch of things. I tried setting
it to 0, then -1. I tried to call ClearSelection() then set it to -1,
but no avail. This is a listbox, for crying out loud! This ought to
be simple, but is not.

Need help.

.



Relevant Pages

  • Re: Last Selection from MultiSelect Listbox
    ... What you can do is track the listbox selection in an array by modifying an array every time the listbox is changed. ... Dim idx As Integer, i As Integer ...
    (microsoft.public.excel.programming)
  • Re: Select range & copy
    ... I changed the range name of the ListBox stuff to mRefList ... "tvac" wrote: ... > Private Sub ListBox1_Click ... >> The first 2 columns have common data regardless of the selection. ...
    (microsoft.public.excel.programming)
  • Re: List of values
    ... I have to assume that the listbox is set to ... single-selection listbox. ... Private Sub ButtonOK_Click ... have shown is only the code to load the data into the listbox and display ...
    (microsoft.public.word.vba.general)
  • Re: Creating a Drop down list where can pick more than one choice
    ... do both tasks (make the listbox visible, and write the selected items into ... <MS ACCESS MVP> ... "Ken Snell MVP" wrote: ... Or do you want each selection to appear in the ...
    (microsoft.public.access.forms)
  • Re: List boxes in Microfocus Dialog System/Net Express?
    ... listbox is question is called a "Selection Box" in Dialog System and ... Dialog System's listbox rows start at 1. ... It wont necessarily be apparent from the demo project titles ... None of the examples I've found show how to accomplish what I'm trying ...
    (comp.lang.cobol)