I have grid with columns (DataSource is object from DB context ( DataSource="trainingCycleTemplate.CycleTemplates")):
<GridColumns>
<GridColumn Field="@nameof(CycleTemplateModel.Id)" IsIdentity="true" IsPrimaryKey="true" Visible="false"></GridColumn>
<GridColumn Field="@nameof(CycleTemplateModel.Name)"></GridColumn>
<GridColumn Field="@nameof(CycleTemplateModel.Percent)"></GridColumn>
<GridColumn Field="@nameof(CycleTemplateModel.Order)"></GridColumn>
</GridColumns>
The problem is: when I'm adding new records and then I need to change it. All new records is changed, because id =0.
If I save everything in DB. Then ID is populated with identity values and everything is ok.
What should I do to have a possibility change record before saving to DB.