As I understood from the description of the problem, the ValeursResult
class is not persistent i.e. it is not mapped to table, and you are using it to populate the WPF datagrid. That is why when you are making changes in the datagrid, the database is not updated. You can look at the ValeursResult
class as a Database View, which is read-only. You can populate the values in the properties, but when you change them the values in the database could not be changed.
To workaround this issue I will recommend you to take a look at the WebAPI with WPF MVVM
sample in Telerik OpenAccess SamplesKit
. The datagrid there is mapped to one table - "Cars
" but at the same time shows values from the other table - "Categories
". This approach is implemented with a converter and you can find the source code in the "CategoryIDToNameConverter.cs" class. Also you can take a look at the "CreateEditViewModel.cs
" where the form is bind again to the "Cars
" table, but there is a combobox which is bind to "Categories
" and the value is selected from this table.
I hope that helps.
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features
shipped with our latest release!