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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Keeping the .AllowEditing(false) different for the Add form and Edit form

Thread ID:





140964 Nov 15,2018 10:54 PM UTC Nov 19,2018 08:25 AM UTC ASP.NET MVC 3
Tags: Grid
Asked On November 15, 2018 10:54 PM UTC

I am using the ASP.net MVC grid.
I am using InlineForm to modify the data. I don't want certain fields to be editable so in a column, i have set AllowEditing(False) as shown below. however i do this Fields to be editable in the Add form but its disabled.  does anyone knows how to achieve this?

   col.Field(x => x.Handing)

Vignesh Natarajan [Syncfusion]
Replied On November 16, 2018 10:41 AM UTC

Hi Sandip, 
Thanks for contacting Syncfusion support.  
From your query, we understand that you need prevent the column from being edited and at same time you need to add values to that column while adding. We have achieved your requirement using ActionComplete event of ejGrid.  
Refer the below code example 
                    .Datasource(ds => ds.URL("UrlDataSource").UpdateURL("UrlUpdate").InsertURL("UrlInsert").RemoveURL("UrlDelete") 
                    .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); }) 
                    .                    .                 .                .                  .              .          .  
<script type="text/javascript"> 
    function Complete(args) {   
        if (args.requestType == "beginedit") {  // disable when request type is beginedit  
            //Grid ID + ColumnName 
            $("#GridCustomerID").attr("disabled",true);  // disable the element from editing 
For your convenience we have prepared a sample which can be downloaded from below link 
Refer the below Knowledge base document to disable the dropdownlist while editing and enable it while adding  
Refer our help documentation for your reference 
Please get back t us if you have further queries. 
Vignesh Natarajan  

Replied On November 19, 2018 12:21 AM UTC

Thanks. This solution works for me.

Vignesh Natarajan [Syncfusion]
Replied On November 19, 2018 08:25 AM UTC

Hi Sandip, 

Thanks for the update. 

We are glad to hear that your query has been resolved by your solution. 

Please get back to us if you have further queries. 

Vignesh Natarajan  


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

Live Chat Icon For mobile
Live Chat Icon