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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

EditMode exclude Primarykey to be posted as 0?

Thread ID:

Created:

Updated:

Platform:

Replies:

141959 Jan 13,2019 03:23 AM UTC Jan 14,2019 11:17 AM UTC ASP.NET MVC - EJ 2 1
loading
Tags: Grid
Emil
Asked On January 13, 2019 03:23 AM UTC

Hi,
when i use editmode as Dialog, 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
{
[Key]
public int id { get; set; }
}

@(Html.EJ().Grid("Grid")
.Datasource((IEnumerable)Model)
.Datasource(dataSource => dataSource.Json((IEnumerable
)Model).UpdateURL("/FeedBacks/Edit")
.InsertURL("/FeedBacks/Create").RemoveURL("/FeedBacks/Delete").Adaptor(AdaptorType.RemoteSaveAdaptor))
.AllowSorting()
.AllowFiltering()
.AllowResizeToFit()
.AllowResizing()
.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
.EditSettings(edit => { edit.AllowAdding().AllowDeleting()
.AllowEditing().ShowDeleteConfirmDialog().EditMode(EditMode.Dialog); })
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
}).CustomToolbarItems(new List() { new Syncfusion.JavaScript.Models.CustomToolbarItem() { TemplateID = "#Details" } });
}).ClientSideEvents(eve => eve.Create("create").ToolbarClick("ToolBarClick"))
.Columns(col =>
{
col.Field("id").HeaderText("ID").Width(50).IsPrimaryKey(true).AllowEditing(false).Add();

Logesh Rajappa [Syncfusion]
Replied On 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. 
 
Regards, 
Logesh Rajappa 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;