We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

EditMode exclude Primarykey to be posted as 0?

when i use editmode asDialog, it display Id which is PK in the dialog and when i save it, it will post as 0. this cause modalstate.IsValid=false. is there anyway to omit this field or fix it somehow?
public partial class FeedBack
public int id { get; set; }
.Datasource(dataSource => dataSource.Json((IEnumerable
.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
.EditSettings(edit => { edit.AllowAdding().AllowDeleting()
.AllowEditing().ShowDeleteConfirmDialog().EditMode(EditMode.Dialog); })
.ToolbarSettings(toolbar =>
toolbar.ShowToolbar().ToolbarItems(items =>
}).CustomToolbarItems(new List<object>() { new Syncfusion.JavaScript.Models.CustomToolbarItem() { TemplateID = "#Details" } });
}).ClientSideEvents(eve => eve.Create("create").ToolbarClick("ToolBarClick"))
.Columns(col =>

1 Reply

LR Logesh Rajappa Syncfusion Team January 14, 2019 11:17 AM UTC

Hi Emil, 

Greetings from Syncfusion. 

Query :  when i use editmode as Dialog, it display Id which is PK in the dialog 
From your query we suspect that you would like to hide a ‘id’ column when editing a grid row using dialog editing. Please refer to the below documentation to achieve your requirement, 
If we have misunderstood your query, then please get back to us with more information about the query in detail. 
Logesh Rajappa 

Live Chat Icon For mobile
Up arrow icon