SubSonic 3 screws up selecteditem?

Posted by SteveCav on Stack Overflow See other posts from Stack Overflow or by SteveCav
Published on 2010-06-17T04:14:51Z Indexed on 2010/06/17 5:43 UTC
Read the original article Hit count: 352

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about subsonic