Hello,
Recently inserting rows using AddNewRowPosition no longer works. This is the code snipped that i tried to showcase the issue:
public class DataModel : NotifyPropertyChanged
{
public DataModel(double x, double y)
{
_xValue = x;
_yValue = y;
}
private double _xValue;
public double XValue
{
get => _xValue;
set => Set(ref _xValue, value);
}
private double _yValue;
public double YValue
{
get => _yValue;
set => Set(ref _yValue, value);
}
}
in my viewmodel I have:
private ObservableCollection< DataModel > _dummyData = new();
public ObservableCollection< DataModel > DummyData
{
get => _dummyData;
set => Set(ref _dummyData, value);
}
In xaml:
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="1"
AddNewRowPosition="Bottom"
AllowDeleting="True"
AllowDraggingColumns="True"
AllowDraggingRows="True"
AllowDrop="True"
AllowEditing="True"
AllowFiltering="True"
AllowResizingColumns="True"
AutoGenerateColumns="False"
EnableDataVirtualization="True"
GridCopyOption="CopyData,CutData"
GridPasteOption="PasteData"
ItemsSource="{Binding DummyData, Mode=TwoWay}"
LiveDataUpdateMode="AllowDataShaping"
SelectionMode="Extended"
SelectionUnit="Row"
ShowRowHeader="True"
UsePLINQ="True">
MappingName="XValue"
MaxValue="360"
MinValue="0"
NumberDecimalDigits="2" />
I can click and edit the insert row:
But after I press enter:
The values are not added
Note that if I modify the collection from the viewmodel, the binding works.
Thank you for your help!
Hello,
Thank you, that was it.
Best regards,
Emanuel Hristea
Hi Emanuel,
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Sampath Narayanan.S