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

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

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)

3 Replies

VN Vignesh Natarajan Syncfusion Team 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  

SA Sandip November 19, 2018 12:21 AM UTC

Thanks. This solution works for me.

VN Vignesh Natarajan Syncfusion Team 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  

Live Chat Icon For mobile
Up arrow icon