- Home
- Forum
- ASP.NET MVC
- Auto Increment Column in Ej Grid
Auto Increment Column in Ej Grid
Hi Ganga,
Thanks for using Syncfusion Products.
We would like to let you know that, in server-side CRUD operation with an Identity Column in database table, we can have auto increment Grid column using “IsIdentity” Grid Column Property. Please refer the following code snippets.
|
@(Html.EJ().Grid<EJGrid.Models.Order>("FlatGrid") ... .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsIdentity(true).IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add(); ... }) |
During add operation, the Identity column would be disabled and on save, the record would be updated with the incremented value obtained from server-side database.
Also For your information, that until Essential Studio version 12.4.0.30 we had issue with “Primary Key value becomes empty after adding a record when IsIdentity property is set as true” and it is now has been fixed in our latest version 12.4.0.34 which can be downloaded from below link.
If we misunderstood your requirement or you would like to use only client-side CRUD operation then please get back to us so that we could provide you a response as early as possible.
Please let us know if you have any queries.
Regards,
Alan Sangeeth S
Hi Ganga,
Thanks for using Syncfusion Products.
We would like to let you know that, in server-side CRUD operation with an Identity Column in database table, we can have auto increment Grid column using “IsIdentity” Grid Column Property. Please refer the following code snippets.
@(Html.EJ().Grid<EJGrid.Models.Order>("FlatGrid")
...
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsIdentity(true).IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
...
})
During add operation, the Identity column would be disabled and on save, the record would be updated with the incremented value obtained from server-side database.
Also For your information, that until Essential Studio version 12.4.0.30 we had issue with “Primary Key value becomes empty after adding a record when IsIdentity property is set as true” and it is now has been fixed in our latest version 12.4.0.34 which can be downloaded from below link.
If we misunderstood your requirement or you would like to use only client-side CRUD operation then please get back to us so that we could provide you a response as early as possible.
Please let us know if you have any queries.
Regards,
Alan Sangeeth S
Hi Alan Sangeeth,
It seems to be with the grid logic because when you add an item to the grid, the record in the database gets the appropriate ID but the grid doesn't retrieve and display it.
- 4 Replies
- 5 Participants
-
GA Ganga
- Mar 4, 2015 11:01 AM UTC
- May 11, 2016 01:04 PM UTC