- Home
- Forum
- ASP.NET MVC
- Ignore a column field in the grid editing form
Ignore a column field in the grid editing form
Before we start working on your query, could you please confirm us the following details so that we could provide you a response as early as possible?
- Which EditMode you are using in your end? Please find the details about EditMode in following documentation.
http://help.syncfusion.com/aspnetmvc/grid/editing#edit-mode - Product Version you are using.
Information provided would be great helpful for us to resolve the issue.
Regards,
Alan Sangeeth S
- Which EditMode you are using in your end?
http://help.syncfusion.com/aspnetmvc/grid/editing#edit-mode
- Product Version you are using?
We can use Command column and isUnbound propery of Grid to avoid the non-editable field from displayed in the Dialog Edit mode. Please refer to the below code example.
|
@(Html.EJ().Grid<Object>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.data) .AllowPaging() .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog); }) .ToolbarSettings(toolbar => { toolbar.ShowToolbar().ToolbarItems(items => { . . . . items.AddTool(ToolBarItems.Cancel); }); }) .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Add(); . . . . col.HeaderText("Employee Details").Commands(command => { command.Type("detail") .ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties() { Text = "Details", Width = "100px", Click = "onClick" }).Add(); }) .IsUnbound(true) .Add(); }) ) <script> function onClick(args) { var obj = $("#FlatGrid").ejGrid("instance"); var OrderID = obj.model.currentViewData[this.element.closest("tr").index()].OrderID ;//Retrieved the clicked(button) record alert("OrderID"+OrderID); } |
We have prepared a sample with the above solution that can be downloaded from the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/121074/ze/MvcApplication4928870338
Regards,
Seeni Sakthi Kumar S.
Before proceeding with your requirement we need below details,
The provided information will help to analyze the issue and we will update you the response as early as possible.
Regards,
Gowthami V.
}
- Then, when I click a row button, if Condition is true (for that row) the button calls an action of a controller passing ForeignKey1 through GET.
- If Condition is false (for that row) the button calls an action of a different controller, passing ForeignKey2 through GET.
Hi Carlo,
We have created a custom sample request for your requirement and created a new support incident under your account. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Regards,
Gowthami V.
Thanks for the update.
Please follow-up with the incident created under your account for any queries regarding custom sample.
Regards,
Alan Sangeeth S
- 9 Replies
- 4 Participants
-
CA Carlo
- Nov 9, 2015 09:39 AM UTC
- Dec 7, 2015 07:17 AM UTC