views:

31

answers:

0

If you have a moment, please try this:

-Download Subsonic 3.
-Start a new proj and add SS's ActiveRecord templates.
-Point it to any SQL Server DB and generate the classes.
-Add a WPF project.
-Create a window and add a combobox or listbox.
-Set the ItemsSource from the SS DAL, and format it how you wish.
-Add a button that will show you some value from the SelectedItem (using messagebox, console, whatever).
-Run the project.
-Click on the third item in the list.
-Click on the second item in the list.
-Click on the button.

When I do that, the button gives me the value of the THIRD item, not the second. In other words, once the SelectedItem is set the first time it STAYS, no matter which item is subsequently highlighted on the screen.

This is happening to me whatever control I use (combobox, listbox, even datagrid) and it ONLY happens with Subsonic Activerecord objects. If I write my own POCOs with identical properties and bind a list of them instead, the controls behave as expected.

Does this happen to you? Any ideas?

...Anyone? anyone? Bueller? I can't believe that SS3 is UNUSABLE with WPF, and it should be so easy to confirm/deny...

ONE MONTH LATER Well, I finally solved it with two words: ENTITY FRAMEWORK. And I'll never use SubSonic again.