Closed Methraen closed 4 years ago
...
ForecastOld = await Http.GetJsonAsync<TestDto[]>("sample-data/test.json");
ForecastNew = await Http.GetJsonAsync<TestDto[]>("sample-data/test.json");
dataAdapter = new CollectionTableDataAdapter<TestDto>(ForecastNew);
...
public void ItemSavedOperationFinished(SaveResultArgs saveResultArgs)
{
bool res = false;
TestDto ItemSaved = (TestDto)saveResultArgs.Item;
TestDto newObj = ItemSaved.CopyPaste();//newObj get the values of ItemSaved without being on the same memory space
for (int i = 0; i < ForecastOld.Length; i++)
{
if (newObj.Code == ForecastOld[i].Code)
{
if (!newObj.IsEqual(ForecastOld[i]))
{
res = true;
ForecastOld[i] = newObj;
UpDate[newObj.Code] = DateTime.Now;
}
break;
}
}
if (res == true)
{
Console.WriteLine($"Item saved result: {saveResultArgs.ItemSucessfullySaved}");
Console.WriteLine(saveResultArgs.Item.ToString());
}
else Console.WriteLine("The item was not modified");
}
@Methraen
New verison is released and this issue should be sovled
@Mewriick 1 - When i save a new value on a row, 2 - And then, i save another row without changing any value this time, 3 - The value that was changed in the first case replaced the unchanged value of the second one