getting Listboxes to communicate
(I posted this also in the Beginner section, but now that I think about it, this question is probably not a beginner question.)
have 2 listboxes dependent on each other -- choose one thing in the first, and the second opens a related listbox. I'm using ASP.NET 2.0, and have the listboxes bound to data in two different tables, with the second table having a column with the relation to listbox1 (the data portion is the next step). For now, my question is understanding the listbox since it's a collection.
I found similar code where gridview and detailsview controls communicate, and tried to apply it to Listboxes:
listbox2.selectedindex = listbox1.selectedindex;
in the SelectedIndexChanged event (C#), and the second box doesn't show the related items. Do I need different code because the control is a collection?
|