This question is locked. New answers and comments are not allowed.
wow i am fighting with this for 2 days now !
i am displaying the result of this linq query in a wpf datagrid
the ValeursResult type is declared like this
the datagrid id bound to the collectionviewdource with this
now i can view the result in my datagrid, i can change the values in the cells ,
but the update is not done on the server with
i have also tried this line of code just before calling savechanges
but again the databse table is never updated
thanks for your help
i am displaying the result of this linq query in a wpf datagrid
var v = from p in _context.EXAMENS_VALEURs
join b in _context.EXAMENS_TYPES_VALEURs on p.EXV_ID_VALEUR_TYPE equals b.ID_EXAMEN_TYPE_VALEUR
join c in _context.EXAMENS_TYPES_GROUPEs on b.EXTV_ID_GROUPE equals c.ID_EXAMEN_TYPE_GROUPE
select new ValeursResult()
{
ID = p.ID_EXAMEN_VALEUR,
Designation = b.EXTV_DESIGNATION,
Groupe = c.EXTG_DESIGNATION,
Valeur = p.EXV_VALEUR
};
((CollectionViewSource)this.FindResource("ExamensView")).Source = v.ToList();
the ValeursResult type is declared like this
public class ValeursResult
{
public int ID { get; set; }
public string Groupe { get; set; }
public string Designation { get; set; }
public string Valeur { get; set; }
}the datagrid id bound to the collectionviewdource with this
<DataGrid x:Name="grd2" AutoGenerateColumns="True" ItemsSource="{Binding Source={StaticResource ExamensView}}" />now i can view the result in my datagrid, i can change the values in the cells ,
but the update is not done on the server with
_context.Savechanges()i have also tried this line of code just before calling savechanges
((ListCollectionView)((CollectionViewSource)this.FindResource("ExamensView")).View).CommitEdit();but again the databse table is never updated
thanks for your help