well, tried using multiview.activeindex, does not work, tried using control.visible, does not work, here is my problem:

I have a dropdownlist with 4 items, by selecting a value, it should show me 4 different controls:

selected index 1: listbox1 - binds data to field A in table 1, but list is retrieved from table 2

selected index 2: listbox2 - binds data to field A in table 1, but list is retrieved from table 3

selected index 3: textbox 1 - binds data to field A in table 1, shows string1.

selected index 4: textbox 2 - binds data to field A in table 1, shows string2.

I need to buypass listbox2, text1, textbox2 if my dropdownlist index 1 is selected because otherwise I get errors like:

'ListBox2' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
How can I get this to work?

Additional info:
I use a master page.
I use formview
I use editformview
I use datasets

Thank you.

Recommended Answers

All 2 Replies

Put them in a select statement:

Select Case ddl.SelectedIndex
    Case 1 : 'code
    Case 2 : 'code
    Case Else : 'code if none found.
End Select

no, this will not work because you can't skip controls with that statement.

I've got it resolved, thank you though.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.