addhandler catch 22
Hi,
I have an (in advance) unknown number of dropdownlists in an arraylist. I add a handler like this:
AddHandler arraylist(i).SelectedIndexChanged, AddressOf SomeDropDownList_SelectedIndexChanged
Now I want to make the following event handler:
Private Sub SomeDropDownList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
DoSomething()
End Sub
Which does not work, because I have to define which dropdown it handles (!!??)
handles a_Specific_dropdown.SelectedIndexChanged.
But if I have to define which dropdown this event handles, what use is it to generate dropdowns at runtime (based on a database query)? Can't I define just one event handler, and let it handle all (new and unknown untill runtime) dropdownlists? This one is driving me crazy for a long time now... could somebody please help me?
Roog
|