SteveoAtilla Posted May 15, 2006 Posted May 15, 2006 Hey, I have a dropdown list on a form that is behaving in a very bizzare fashion. Here is the behavior: List is loaded with text and values via a loop, not bound to a data source. List has multiple values, and an OnIndexChanged event (yes, it is AutoPostBack True). I can select (in one example with seven elements) any of the first five values (Indexes 0 thru 4), but when I select either indexes five or six, the IndexChanged event never fires. Further, when I start from index 3, for example, and choose the sixth element (index 5) from the list, the Text, Value and Index for the dropdown list are FOR THE FIFTH ITEM IN THE LIST (Index 4). Same thing happens with the last element. What would cause this? Here is the SelectedIndexChanged code: Private Sub selPartsList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles selPartsList.SelectedIndexChanged Dim SelText As String = selPartsList.SelectedItem.Text Dim SelValue As String = selPartsList.SelectedValue.ToString Dim SelIndex As Integer = selPartsList.SelectedIndex ResetDataEntryForm() Session("ShowHide") = "Show" cmdPartStatus.Text = "Show Part Detail" Session("PartDetailBOMPK") = selPartsList.SelectedItem.Value lstPartDetail.Items.Clear() lstPartDetail.Visible = False selPartsList.SelectedIndex = SelIndex End Sub What could there possibly be in the code to cause this type of behavior? I have debugged the code by putting a stop in immediately in the procedure, and the values are as listed above. Has anyone ever seen this before???? Quote The three most important things in life: God, your family, and the Green Bay Packers -- Not necessarily in that order. Winning is not a sometime thing. You don't win once in a while, you don't do things right once in a while, you do them right all the time. Winning is a habit. Unfortunately, so is losing. -- Vincent T. Lombardi
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.