List selectedIndex property changed with lists created from a database

I am trying to use list controls to navigate my database. The first list holds the top level nodes, when one is selected it retrieves the child nodes from the database and puts then in the next list control, this repeats for a few more layers.

The problem is that when a parent node is changed I need to set the selectdIndex of the lower level lists to 0 to as all nodes have a different number of children. The selectedIndex however seems to be updated at the page polling rate and is set to -1 then back to it’s original value every poll. Once you add a few more lists to this you end up with a page that constantly spews out errors.

How do I properly detect a change in the list control selectedIndex initiated by the user?

First, set your queries to no polling. You definitely will crash and burn if your don’t, as every dataset update on a list will briefly set the selectedIndex to -1 while the dataset is swapped. That creates a cascade of unwanted selectedIndex change events that will scramble your logic.
Rely on the auto-update of your queries when an embedded property reference changes (in a where clause, presumeably), or even better, generate the downstream datasets with a script.
You’ll have to pre-emptively set downstream lists’ selections to -1 before the updated queries happen.