drop down list events

  • Thread starter Thread starter kate hall
  • Start date Start date
K

kate hall

I have created a drop down list and populated from db. When an item is
selected, I want to then populate and make visible a second list based
on the value of the first.
My problem is that I can't get the selection to be detected...
I have coded


Sub ddlDistricts_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ddlDistricts.SelectedIndexChanged
Dim wsGetAreas As New localhost.myWebservice1()
dsAreas = wsGetAreas.GetAreas(ddlDistricts.ID, boolerr)
ddlAreas.DataSource() = dsAreas
ddlAreas.Visible() = True
End Sub

but the event never triggers..
What am I doing wrong?

kate
 
Try coding against the ValueMemberChanged event instead.
The SelectedIndexChanges event may not work too well with
bound list controls but the ValueMemberChanged event
should fire correctly.

HTH,

Simon.
 
Just thought - depending on how you've bound your
combobox you may need to use the DisplayMemberChanged
event instead. Try both and see which work.

(ps. These are both events that ComboBox inherits from
ListControl and specifically relate to data bound lists)
 
Back
Top