B
bill yeager
I have a listbox whose autopostback property is set
to 'true'. When this event fires, I have code in
the 'SelectedIndexChanged' event to capture the
selectedindex of the listbox to be reset on the listbox
when the postback occurs. However, the selectedindex
property is alway -1.
Below is the code prior to selecting an item for this
listbox. Right after I select an item, the following code
executes, which I'm expecting, but
the "lstRider.SelectedIndex" value is -1, and I don't know
why.......
<code>
Private Sub lstRider_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
lstRider.SelectedIndexChanged
viewstate.Item("Rider1Idx") =
lstRider.Items.Item(lstRider.SelectedIndex).Value()
End Sub
</code>
Can anybody inform me how I can capture the index of the
selected item in the list???
to 'true'. When this event fires, I have code in
the 'SelectedIndexChanged' event to capture the
selectedindex of the listbox to be reset on the listbox
when the postback occurs. However, the selectedindex
property is alway -1.
Below is the code prior to selecting an item for this
listbox. Right after I select an item, the following code
executes, which I'm expecting, but
the "lstRider.SelectedIndex" value is -1, and I don't know
why.......
<code>
Private Sub lstRider_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
lstRider.SelectedIndexChanged
viewstate.Item("Rider1Idx") =
lstRider.Items.Item(lstRider.SelectedIndex).Value()
End Sub
</code>
Can anybody inform me how I can capture the index of the
selected item in the list???