I've searched on many threads but I couldn't find anything to solve my problem, and I don't really know what keywords I should use. I have a DataGrid which is populated by a DataSet, with columns that I specify manually.
In my column, 'Total', the Binding is set by :
<DataGridTextColumn Header="Total"
Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type UserControl}},
Path=DataContext.Total}"
The Total property is not in the DataSet, which is bound to my DataGrid, that's why I use this kind of Binding.
The problem is that when I set a value inside a cell of 'Total', like any user would do, this value is repeated in each cell of my column.
So, I know it is because of this property, since everytime I change my cell's value the Total property gets this new value and sends it back to my column. I could use a condition which uses the selected row's number or something, I have some ideas of what I should do, but I can't do that in my Xaml code.
I tried to create a Binding() in the code behind part but it doesn't really work and I'm not sure it could change anything.
Is there any way to use one value per row in this case ?
Thanks !