Hi, I have custom objects I am binding to using ObjectDataSource. I have three-level binding: a DropDownList (Department) that filters the next DropDownList (Category) that filters a GridView (Questions). Each ObjectDataSource binds to the previous control's SelectedValue (except the first one, of course).
Everything works fine only to the next level (Department to Category and Category to Questions). When I change the Department, the Category list gets updated correctly, but the Questions that show up are from the previously selected category.
How can I get this three-level binding to work correctly? I can't figure out whether I am missing something. If I have to, I could implement SelectedIndexChanged on the first list and manually force the update on the grid, but this is not ideal. Thanks for your help!
A bit more info: I don't have a default "select an item" option. That means that when I change the Department, the first Category is automatically selected. I was hoping the binding would be smart enough to trickle that all the way down. It was smart enough that I didn't have to do the if (!IsPostBack) { // Load data }.
I currently have implemented Department_SelectedIndexChanged() and simply done a Questions.DataSource = Questions.DataSource;. That seems to "refresh" everything properly. Is there a better way to do this?