Hi, Mohammed. Thank you very much for your reply.
However, the problem is not type="number". The problem is the primary key with Auto Increment. We should give it a default value even if the key field is automatic increment. The problem disappeared after editing .cshtml as follows.
<ejs-grid id="Grid" allowPaging="true" locale="tr-TR" load="onLoad" toolbar="@( new List<object>() {"Add","Edit","Delete","Update","Cancel"})">
<e-grid-editsettings allowAdding="true" allowDeleting="true" allowEditing="true" ></e-grid-editsettings>
<e-data-manager url="/Index?handler=DataSource" insertUrl="/Index?handler=Insert" updateUrl="/Index?handler=Update" removeUrl="/Index?handler=Delete" adaptor="UrlAdaptor"></e-data-manager>
<e-grid-pageSettings pageCount="5" pageSize="5"></e-grid-pageSettings>
<e-grid-columns>
<e-grid-column field="ID" headerText="ID" isPrimaryKey="true" isIdentity="true" defaultValue="0" type="number" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="UrunKodu" headerText="Kodu" width="150"></e-grid-column>
<e-grid-column field="UrunAdi" headerText="Adi" width="150"></e-grid-column>
<e-grid-column field="Fiyat" headerText="Fiyat" textAlign="Right" format="N2" type="number" width="140"></e-grid-column>
<e-grid-column field="Tarih" textAlign="Right" headerText="Tarih" editType="datepickeredit" width="150"></e-grid-column>
<e-grid-column field="Durum" headerText="Durum" textAlign="Center" editType="booleanedit" displayAsCheckBox="true" type="boolean" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid>
Thus, the program can perform all CRUD operations without any problems.
But now I have a new problem:
When I created the model, I defined a Unique Key for the UrunKodu field.
modelBuilder.Entity().HasAlternateKey(b => b.UrunKodu);
In this case, I get the following error message when I want to change and save the abcd field.
There is no error when I use Index instead:
modelBuilder.Entity().HasIndex(u => u.UrunKodu).IsUnique();
Why does Unique Key fail? How can I fix this problem?