This question is locked. New answers and comments are not allowed.
Hi,
I am testing a RadGridView to let a user view and edit an article list via RIA services.
My Entity articles is bound to a DomainDataSource articleSource.
One column in this gridview is a GridViewComboBoxColumn.
This ComboBox is fed by an entity articlegroup in the DomainDataSource articleGroups.
The entity articles is bound to the entity articleGroup via the property ID => articleGroup .ID.
So far everything works, I can view the grid, every ComboBox is filled with all articleGroup entries
and the selected entries are set correctly.
But as soon as I change the selected entry in a ComboBox and then save the changes by using
articles.SubmitChanges();
I get the error message
The value of key member 'ID' on an instance of an entity of type 'articleGroup ' has changed. Entity key members cannot be changed.
Here is the code for my GridViewComboBoxColumn:
What am I doing wrong? It must be possible to change articleGroup.ID, everything else makes no sense.I must be able to select another articleGroup for an article.
I am testing a RadGridView to let a user view and edit an article list via RIA services.
My Entity articles is bound to a DomainDataSource articleSource.
One column in this gridview is a GridViewComboBoxColumn.
This ComboBox is fed by an entity articlegroup in the DomainDataSource articleGroups.
The entity articles is bound to the entity articleGroup via the property ID => articleGroup .ID.
So far everything works, I can view the grid, every ComboBox is filled with all articleGroup entries
and the selected entries are set correctly.
But as soon as I change the selected entry in a ComboBox and then save the changes by using
articles.SubmitChanges();
I get the error message
The value of key member 'ID' on an instance of an entity of type 'articleGroup ' has changed. Entity key members cannot be changed.
Here is the code for my GridViewComboBoxColumn:
| <telerik:GridViewComboBoxColumn UniqueName="a" Header="a" |
| DisplayMemberPath="Caption" |
| SelectedValueMemberPath="ID" |
| ItemsSourceBinding="{Binding Data, Source={StaticResource articleGroups}}" |
| DataMemberBinding="{Binding articleGroup .ID}"/> |
What am I doing wrong? It must be possible to change articleGroup.ID, everything else makes no sense.I must be able to select another articleGroup for an article.