getting Listboxes to communicate
I 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 had found somewhere an example for the gridview and detailview communicating using similar code, but when I tried it with my listboxes, it didn't work:
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?
|